mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 16:10:20 +00:00
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.
This commit is contained in:
parent
71537f4903
commit
352048ce0e
Notes:
sideshowbarker
2024-07-17 05:06:13 +09:00
Author: https://github.com/kuzux Commit: https://github.com/SerenityOS/serenity/commit/352048ce0e Pull-request: https://github.com/SerenityOS/serenity/pull/16386 Reviewed-by: https://github.com/AtkinsSJ
1 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue