diff --git a/minesweeper/.gitignore b/minesweeper/.gitignore new file mode 100644 index 0000000..4429a49 --- /dev/null +++ b/minesweeper/.gitignore @@ -0,0 +1,3 @@ +!.gitignore + +.vscode/ diff --git a/minesweeper/minesweeper.sh b/minesweeper/minesweeper.sh index dac6f0f..e5d0d6c 100755 --- a/minesweeper/minesweeper.sh +++ b/minesweeper/minesweeper.sh @@ -110,7 +110,14 @@ function putflag() (( board[cy*mx+cx]==10 )) && (( mf++ )) (( board[cy*mx+cx]==11 )) && (( mf-- )) - (( mf==mb )) && { + (( mf>=mb )) && { + if (( board[cy*mx+cx]==10 )); then + board[cy*mx+cx]=11 + else + board[cy*mx+cx]=9 + (( mf-- )) + fi + n=0 for ((i=0;i