Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Figuring out eaten cookie issue
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:ac75da0465ba1c3363af3c3f98995b7c88fedcfa837807e000b001275ed84dbf
User & Date: sarah 2018-05-18 23:06:05
Context
2018-05-19
02:19
cooke monster is happy now Leaf check-in: d9610b5a78 user: zie tags: trunk
2018-05-18
23:06
Figuring out eaten cookie issue check-in: ac75da0465 user: sarah tags: trunk
22:54
End game check-in: 9cb3cdd267 user: sarah tags: trunk
Changes

Changes to finalproject/finalproject.cpp.

87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
};
// DO NOT ALTER OR DELETE THIS CODE (END)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

class MyPickUpGame : public PickUpGame
{
    public:
      int CookieNumber;
      int EatanCookies;
      void createCookies()

      {

            CookieNumber = 1 + rand() % 10;

            for (int i = 0; i < CookieNumber; i++)
            {
                  int RandomxPos;
................................................................................
                  return true;
            }
            return false;
      }

      void MyMove(char Direction)
      {
            EatanCookies = 0;
            switch (static_cast<int>(Direction)) //Don't know the ASCII characters for the arrow keys so use the ASCII numbers
            {
            case 65: //Up arrow
                  // cout << "UP\n";
                  Screen[xPos][yPos] = ' '; //Wipe out the users current cursor
                  xPos--;                   //Move the users x position on the grid
                  if (checkCookies(xPos, yPos))
................................................................................
                  }
                  Screen[xPos][yPos] = '>';
                  break;
            }
      }

      void endgame()
      {
            cout << "COOKIE MONSTER";
            EatanCookies = EatanCookies + 1;
            cout << EatanCookies << "\n";
            if (EatanCookies = CookieNumber)
            {
                  cout << "You ate " << CookieNumber << "cookie(s)";
                  exit(0);
            }
      }

      void BoundedMove(char UserMove)







|

>







 







|







 







|


|
|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
};
// DO NOT ALTER OR DELETE THIS CODE (END)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

class MyPickUpGame : public PickUpGame
{
    public:
      int CookieNumber;
      int EatanCookies = 0;
      void createCookies()
      
      {

            CookieNumber = 1 + rand() % 10;

            for (int i = 0; i < CookieNumber; i++)
            {
                  int RandomxPos;
................................................................................
                  return true;
            }
            return false;
      }

      void MyMove(char Direction)
      {
            
            switch (static_cast<int>(Direction)) //Don't know the ASCII characters for the arrow keys so use the ASCII numbers
            {
            case 65: //Up arrow
                  // cout << "UP\n";
                  Screen[xPos][yPos] = ' '; //Wipe out the users current cursor
                  xPos--;                   //Move the users x position on the grid
                  if (checkCookies(xPos, yPos))
................................................................................
                  }
                  Screen[xPos][yPos] = '>';
                  break;
            }
      }

      void endgame()
      { 
            cout << "COOKIE MONSTER";
            EatanCookies = EatanCookies + 1;
            cout <<"You have eat"<< EatanCookies << "\n";
            if (EatanCookies == CookieNumber)
            {
                  cout << "You ate " << CookieNumber << "cookie(s)";
                  exit(0);
            }
      }

      void BoundedMove(char UserMove)