unused stuff
This commit is contained in:
parent
f97154b96c
commit
9c9b99788a
|
@ -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 )
|
||||
|
|
14
app/Model.hs
14
app/Model.hs
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user