From 352048ce0e43821740e637cc920e39a549cf59a7 Mon Sep 17 00:00:00 2001 From: Arda Cinar Date: Thu, 8 Dec 2022 21:41:56 +0300 Subject: [PATCH] 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. --- Userland/Games/Minesweeper/CustomGameDialog.cpp | 5 ++--- 1 file 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)