Browse Source

Implement toggleFlag

DricomDragon 5 years ago
parent
commit
0459a197fa
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tp/mine-sweeper/main.hs

+ 4 - 0
tp/mine-sweeper/main.hs

@@ -126,6 +126,10 @@ won g nbMines =
     let nbUnco = sum (map sum uncoBinMatrix) in
     nbUnco == nbTotal - nbMines
 
+toggleFlag::Cell -> Cell
+toggleFlag (Covered n b flag) = Covered n b !flag
+toggleFlag c = c
+
 
 -- Testing data