mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
5562ef6cc5
The existing method was simply using a "randomly generate until it fits our criteria" method to generate a game field. While this worked OK in most cases, the run time was increasing seriously in boards whose mine count / board size ratio was too big. The new approach simply generates every possible mine location, shuffles the array and picks its head. This uses more memory (shouldn't be a big deal since minesweeper boards are generally miniscule) but runs much quicker. The generation could still use some improvement (regarding error handling), though :^) |
||
---|---|---|
.. | ||
2048 | ||
BrickGame | ||
Chess | ||
FlappyBug | ||
Flood | ||
GameOfLife | ||
Hearts | ||
MasterWord | ||
Minesweeper | ||
Snake | ||
Solitaire | ||
Spider | ||
CMakeLists.txt |