Score rendering
This commit is contained in:
parent
1dd23d6e62
commit
ffb2a087e1
8 changed files with 203 additions and 119 deletions
10
test/Main.hs
10
test/Main.hs
|
|
@ -1,7 +1,7 @@
|
|||
module Main (main) where
|
||||
|
||||
import Data.Array (elems, (!))
|
||||
import SnakeLib
|
||||
import Data.Array ((!))
|
||||
import Snake
|
||||
import Test.Tasty (TestTree, defaultMain, testGroup)
|
||||
import Test.Tasty.HUnit (assertEqual, testCase)
|
||||
|
||||
|
|
@ -125,9 +125,3 @@ runTickTests =
|
|||
assertEqual "tail advanced" (1, 0) (snakeTail step4)
|
||||
]
|
||||
|
||||
snakeSegmentCount :: Game -> Int
|
||||
snakeSegmentCount = length . filter isSnakeSegment . elems . gameBoard
|
||||
|
||||
isSnakeSegment :: Tile -> Bool
|
||||
isSnakeSegment (SnakeSegment _) = True
|
||||
isSnakeSegment _ = False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue