Skip to content

Commit

Permalink
Changed difficulty multipliers and added checks to set board info fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
squee72564 committed Jan 7, 2024
1 parent 0bd7b49 commit 32af3ff
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions views/minesweeper_game_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ typedef struct {
} MineSweeperGameScreenModel;

static const float difficulty_multiplier[5] = {
0.05f,
0.16f,
0.18f,
0.22f,
0.25f,
0.15f,
0.17f,
0.19f,
0.23f,
0.27f,
};

/****************************************************************
Expand Down Expand Up @@ -414,6 +414,13 @@ static void mine_sweeper_game_screen_set_board_information(
uint8_t difficulty) {

furi_assert(instance);

// These are the min/max values that can actually be set
if (width > 146) {width = 146};

Check failure on line 419 in views/minesweeper_game_screen.c

View workflow job for this annotation

GitHub Actions / Build Minesweeper for dev channel

expected ';' before '}' token
if (width < 16 ) {width = 16};

Check failure on line 420 in views/minesweeper_game_screen.c

View workflow job for this annotation

GitHub Actions / Build Minesweeper for dev channel

expected ';' before '}' token
if (height > 64 ) {height = 64};

Check failure on line 421 in views/minesweeper_game_screen.c

View workflow job for this annotation

GitHub Actions / Build Minesweeper for dev channel

expected ';' before '}' token
if (height < 7 ) {height = 7};

Check failure on line 422 in views/minesweeper_game_screen.c

View workflow job for this annotation

GitHub Actions / Build Minesweeper for dev channel

expected ';' before '}' token
if (difficulty > 4 ) {difficulty = 4};

Check failure on line 423 in views/minesweeper_game_screen.c

View workflow job for this annotation

GitHub Actions / Build Minesweeper for dev channel

expected ';' before '}' token

with_view_model(
instance->view,
Expand Down

0 comments on commit 32af3ff

Please sign in to comment.