diff options
author | Arda Cinar <kuzux92@gmail.com> | 2022-12-08 21:41:56 +0300 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-12-12 16:23:03 +0000 |
commit | 352048ce0e43821740e637cc920e39a549cf59a7 (patch) | |
tree | d5bd23e26c92f613da503838e85db63996fef862 /Userland/Games/Minesweeper | |
parent | 71537f4903d1369552424db0fc819fd5ef325a79 (diff) | |
download | serenity-352048ce0e43821740e637cc920e39a549cf59a7.zip |
Minesweeper: Revise the maximum mine limit in custom game settings
After improving the mine field generation method, fields with greater
than 50% mines no longer take too long to generate. So, the mine limit
for a given size can be increased to its maximum possible value.
Diffstat (limited to 'Userland/Games/Minesweeper')
-rw-r--r-- | Userland/Games/Minesweeper/CustomGameDialog.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Games/Minesweeper/CustomGameDialog.cpp b/Userland/Games/Minesweeper/CustomGameDialog.cpp index fd52f43932..6020499248 100644 --- a/Userland/Games/Minesweeper/CustomGameDialog.cpp +++ b/Userland/Games/Minesweeper/CustomGameDialog.cpp @@ -34,9 +34,8 @@ GUI::Dialog::ExecResult CustomGameDialog::show(GUI::Window* parent_window, Field void CustomGameDialog::set_max_mines() { - // Generating a field with > 50% mines takes too long. - // FIXME: Allow higher amount of mines to be placed. - m_mines_spinbox->set_max((m_rows_spinbox->value() * m_columns_spinbox->value()) / 2); + // NOTE: this is the maximum number of mines possible in a given minesweeper board + m_mines_spinbox->set_max((m_rows_spinbox->value() * m_columns_spinbox->value()) - 9); } CustomGameDialog::CustomGameDialog(Window* parent_window) |