@@ -17,7 +17,7 @@ main = do
1717pieceA = def_attr `with_fore_color` red
1818dumpA = def_attr `with_style` reverse_video
1919
20−play :: Vty -> Word -> Word -> Word -> Word -> String -> IO ()
20+play :: Vty -> Int -> Int -> Int -> Int -> String -> IO ()
2121play vt x y sx sy btl = do update vt (current_pic x y sx sy btl)
2222 k <- next_event vt
2323 case k of EvKey (KASCII 'r') [MCtrl] -> refresh vt >> play vt x y sx sy btl
@@ -26,15 +26,15 @@ play vt x y sx sy btl = do update vt (current_pic x y sx sy btl)
2626 EvKey KUp [] | y /= 1 -> play vt x (y-1) sx sy btl
2727 EvKey KDown [] | y /= (sy-2) -> play vt x (y+1) sx sy btl
2828 EvKey KEsc [] -> shutdown vt >> return ()
29− EvResize nx ny -> play vt (min x (toEnum nx - 1))
30− (min y (toEnum ny - 2))
31− (toEnum nx)
32− (toEnum ny)
29+ EvResize nx ny -> play vt (min x (nx - 1))
30+ (min y (ny - 2))
31+ nx
32+ ny
3333 btl
34− _ -> play vt x y sx sy (take (fromEnum sx) (show k ++ btl))
34+ _ -> play vt x y sx sy (take sx (show k ++ btl))
3535
3636
37−current_pic :: Word -> Word -> Word -> Word -> String -> Picture
37+current_pic :: Int -> Int -> Int -> Int -> String -> Picture
3838current_pic x y sx sy btl = pic_for_image i
3939 where i = string def_attr "Move the @ character around with the arrow keys. Escape exits."
4040 <-> char_fill pieceA ' ' sx (y - 1)