Browse Source

add testDoppieRotazioni

adaptedStrategy0
kaos 9 years ago
parent
commit
ff0daa0511
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      vm/Tests.hs

+ 11
- 0
vm/Tests.hs View File

@ -19,6 +19,17 @@ testTutto = do
deepCheck (\pivot cell -> cell == counterRotateCell pivot (rotateCell pivot cell))
deepCheck (\pivot cell -> cell == counterRotateCell2 pivot (rotateCell pivot cell))
checkForNothing::[Maybe(Cell, Fallimento)] -> Maybe(Cell, Fallimento)
checkForNothing (Nothing:xs) = checkForNothing xs
checkForNothing ((Just v):xs) = Just v
checkForNothing [] = Nothing
testTutteRotazioni = checkForNothing [
testDoppieRotazioni (2,3) [(2,0), (4,1), (5,4), (3,6), (0,5), (0,2), (2,0)],
testDoppieRotazioni (2,4) [(2,1), (4,3), (4,6), (1,7), (-1,5), (0,2), (2,1)],
testDoppieRotazioni (1,5) [(1,3), (3,4), (3,6), (1,7), (0,6), (0,4), (1,3)]
]
testGame = let board = Board 5 10 (Set.fromList [])
unit = Unit (Set.fromList [(2, 8)]) (2, 8)
game = Game board [unit] (Set.fromList [hash unit])


Loading…
Cancel
Save