File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ main = do
11
11
setupTerm
12
12
inputSource <- startInputLoop
13
13
seed <- fmap fromInteger getCPUTime
14
- mainLoop (freshGame seed) inputSource
14
+ mainLoop inputSource (freshGame seed)
15
15
where
16
16
setupTerm = hSetBuffering stdin NoBuffering >>
17
17
hSetEcho stdin False >> hideCursor
18
18
19
- mainLoop :: Game -> InputSource -> IO ()
20
- mainLoop g@ Game {gameOver= False } is =
21
- drawGame g >> getInputEvent is >>= \ i -> mainLoop ( updateGame i g) is
22
- mainLoop g@ Game {gameScore= s} _ =
19
+ mainLoop :: InputSource -> Game -> IO ()
20
+ mainLoop is g@ Game {gameOver= False } =
21
+ drawGame g >> getInputEvent is >>= mainLoop is . flip updateGame g
22
+ mainLoop _ g@ Game {gameScore= s} =
23
23
drawGame g >> (putStrLn $ " You cleared: " ++ (show s) ++ " lines." ) >>
24
24
showCursor
25
25
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ board cs = Board { boardCells = concat cs
65
65
boardRows :: Board -> [[Cell ]]
66
66
boardRows b = mapChunks id (boardWidth b) (boardCells b)
67
67
68
- emptyCell ,fullCell :: Cell
68
+ emptyCell , fullCell :: Cell
69
69
emptyCell = Cell False
70
70
fullCell = Cell True
71
71
You can’t perform that action at this time.
0 commit comments