You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setCellToRevealed board c = board & elemAt c . isRevealed .~True
81
81
82
+
-- wrapper for the reveal actions, if a cell is not revealed yet, reveal it, otherwise try a quick reveal
83
+
reveal::Board->Coordinate->Board
84
+
reveal board c =if board ^. (elemAt c . isRevealed) then quickReveal board c else revealCell board c
85
+
82
86
-- Reveals a cell at a given coordinate for a given Board
83
87
-- Rule explanation: will also reveal any direct neighbouring Cells which have no bomb and their neighbour cells if the have 0 neighboring bombs
84
88
revealCell::Board->Coordinate->Board
@@ -102,6 +106,23 @@ revealCell board c = resultBoard
102
106
-- In any other case just reveal the cell at (i,j)
103
107
_ -> setCellToRevealed board c
104
108
109
+
-- Quick reveal
110
+
-- If a cell is revealed, has more than one neighboring bomb and the bomb count matches the amount of flagged neighbors all non flagged neighbours can bo quick revealed
0 commit comments