mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 02:38:59 +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: 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()
|
void CustomGameDialog::set_max_mines()
|
||||||
{
|
{
|
||||||
// Generating a field with > 50% mines takes too long.
|
// NOTE: this is the maximum number of mines possible in a given minesweeper board
|
||||||
// FIXME: Allow higher amount of mines to be placed.
|
m_mines_spinbox->set_max((m_rows_spinbox->value() * m_columns_spinbox->value()) - 9);
|
||||||
m_mines_spinbox->set_max((m_rows_spinbox->value() * m_columns_spinbox->value()) / 2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomGameDialog::CustomGameDialog(Window* parent_window)
|
CustomGameDialog::CustomGameDialog(Window* parent_window)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue