unused stuff

This commit is contained in:
Eric Mertens 2022-12-05 21:15:18 -08:00
parent f97154b96c
commit 9c9b99788a
2 changed files with 2 additions and 16 deletions

View File

@ -7,8 +7,8 @@ import Data.Map (Map)
import Data.Map qualified as Map
import Graphics.Vty
import System.Environment ( getArgs )
import System.Directory
import System.FilePath
import System.Directory ( listDirectory )
import System.FilePath ( (</>), takeBaseName )
import Model
import Rendering ( render )

View File

@ -52,26 +52,12 @@ winCondition world =
where
coverage = Set.fromList $ map boxLocation $ Map.elems (worldBoxes world)
makeWalls :: [String] -> Array Coord Bool
makeWalls rows = listArray ((ylo,xlo),(yhi,xhi)) (map (' '/=) (concat rows))
where
h = length rows
w = length (head rows)
(xlo,xhi) = mkRange w
(ylo,yhi) = mkRange h
mkRange :: Int -> (Int,Int)
mkRange n = (- (n-1)`div`2, n`div`2)
boxSize :: World -> Box -> Int
boxSize world box = yhi-ylo+1
where
((ylo,_),(yhi,_)) = bounds (boxWalls world box)
solid :: Int -> Array Coord Bool
solid n = makeWalls (replicate n (replicate n 'x'))
move :: World -> (Int,Int) -> World
move world dir =
case moveBlock world Map.empty (myLocation world) dir 0 of