Skip to content

Commit

Permalink
Merge pull request #10 from maxispeicher/fix-food-placing
Browse files Browse the repository at this point in the history
Ensuring food is placed on grid
  • Loading branch information
SudKul committed Mar 23, 2021
2 parents 8260529 + 53577b2 commit 1e2d9ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Game::Game(std::size_t grid_width, std::size_t grid_height)
: snake(grid_width, grid_height),
engine(dev()),
random_w(0, static_cast<int>(grid_width)),
random_h(0, static_cast<int>(grid_height)) {
random_w(0, static_cast<int>(grid_width - 1)),
random_h(0, static_cast<int>(grid_height - 1)) {
PlaceFood();
}

Expand Down

0 comments on commit 1e2d9ee

Please sign in to comment.