summaryrefslogtreecommitdiff
path: root/Userland/Games/Minesweeper
diff options
context:
space:
mode:
authorArda Cinar <kuzux92@gmail.com>2022-12-08 21:41:56 +0300
committerSam Atkins <atkinssj@gmail.com>2022-12-12 16:23:03 +0000
commit352048ce0e43821740e637cc920e39a549cf59a7 (patch)
treed5bd23e26c92f613da503838e85db63996fef862 /Userland/Games/Minesweeper
parent71537f4903d1369552424db0fc819fd5ef325a79 (diff)
downloadserenity-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.cpp5
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)