Update for new GHC and vty
This commit is contained in:
@@ -6,7 +6,7 @@ import Data.Maybe
|
||||
import Data.List (intersperse, transpose)
|
||||
|
||||
bigText :: String -> [String]
|
||||
bigText = map concat . transpose . intersperse sep . mapMaybe \x -> Map.lookup x letters
|
||||
bigText = map concat . transpose . intersperse sep . mapMaybe (`Map.lookup` letters)
|
||||
|
||||
sep :: [String]
|
||||
sep = [" " ," " ," " ," " ," "]
|
||||
|
@@ -8,6 +8,7 @@ import Data.List.NonEmpty qualified as NonEmpty
|
||||
import Data.Map (Map)
|
||||
import Data.Map qualified as Map
|
||||
import Graphics.Vty
|
||||
import Graphics.Vty.CrossPlatform
|
||||
import Data.Ord (clamp)
|
||||
import System.Directory (listDirectory)
|
||||
import System.Environment (getArgs)
|
||||
|
@@ -172,7 +172,7 @@ enterLoc world name box dir@(dy,dx) offset =
|
||||
go y x = Just
|
||||
(Location name' y x,
|
||||
fromIntegral faceSize * offset
|
||||
- fromIntegral ((abs dy *x + abs dx*y)))
|
||||
- fromIntegral (abs dy *x + abs dx*y))
|
||||
|
||||
((ylo,xlo),(yhi,xhi)) = bounds (boxWalls world box)
|
||||
|
||||
|
@@ -126,7 +126,7 @@ parseColor =
|
||||
walls :: [String] -> UArray Coord Bool
|
||||
walls rows = listArray ((ylo,xlo),(yhi,xhi)) (map ('▓'==) (concat rows))
|
||||
where
|
||||
width = length (head rows)
|
||||
width = case rows of x:_ -> length x; [] -> 0
|
||||
height = length rows
|
||||
ylo = - ((height - 1) `div` 2)
|
||||
yhi = height `div` 2
|
||||
@@ -134,7 +134,7 @@ walls rows = listArray ((ylo,xlo),(yhi,xhi)) (map ('▓'==) (concat rows))
|
||||
xhi = width `div` 2
|
||||
|
||||
mkRange :: Int -> (Int, Int)
|
||||
mkRange n = (-(n-1)`div`2, n`div`2)
|
||||
mkRange n = (-((n-1)`div`2), n`div`2)
|
||||
|
||||
findLocs :: Char -> [[Char]] -> [(Char, Location)]
|
||||
findLocs name xs =
|
||||
|
Reference in New Issue
Block a user