Skip to content

Commit

Permalink
done snake 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mac authored and Mac committed Jun 1, 2024
1 parent 536b2ab commit f45969e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AdvProg_L7-Snake/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void Game::addCherry()
// Suggestion: use rand() function

Position randomPos; // YOUR CODE HERE
randomPos = Position(rand() % width; rand() % height;);
randomPos = Position(rand() % width, rand() % height);

// check if the randomPos is EMPTY
if (getCellType(randomPos) == CELL_EMPTY) {
Expand Down

0 comments on commit f45969e

Please sign in to comment.