mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
2048: Do not allow the creation of games with invalid board sizes
The logic only works with nxn grids, so no need to take separate row_size/column_size arguments.
This commit is contained in:
parent
16e86a3dda
commit
40c16b3ce5
3 changed files with 11 additions and 13 deletions
|
@ -75,7 +75,7 @@ int main(int argc, char** argv)
|
|||
main_widget.set_layout<GUI::VerticalBoxLayout>();
|
||||
main_widget.set_fill_with_background_color(true);
|
||||
|
||||
Game game { 4, 4 };
|
||||
Game game { 4 };
|
||||
|
||||
auto& board_view = main_widget.add<BoardView>(&game.board());
|
||||
board_view.set_focus(true);
|
||||
|
@ -90,7 +90,7 @@ int main(int argc, char** argv)
|
|||
update();
|
||||
|
||||
auto start_a_new_game = [&]() {
|
||||
game = Game(4, 4);
|
||||
game = Game(4);
|
||||
update();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue