Update for new GHC and vty
This commit is contained in:
parent
e83bb7de4c
commit
edcb8eb4f0
|
@ -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 =
|
||||
|
|
|
@ -24,6 +24,13 @@ executable parabox
|
|||
default-extensions: ImportQualifiedPost, BlockArguments, LambdaCase
|
||||
|
||||
ghc-options: -threaded
|
||||
build-depends: base ^>=4.17.0.0, array, containers, vty, directory, filepath
|
||||
build-depends:
|
||||
array,
|
||||
base ^>={4.17, 4.18, 4.19, 4.20},
|
||||
containers,
|
||||
directory,
|
||||
filepath,
|
||||
vty-crossplatform,
|
||||
vty ^>= 6.2,
|
||||
hs-source-dirs: app
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in New Issue
Block a user