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 Data.Map qualified as Map
|
||||||
import Graphics.Vty
|
import Graphics.Vty
|
||||||
import System.Environment ( getArgs )
|
import System.Environment ( getArgs )
|
||||||
import System.Directory
|
import System.Directory ( listDirectory )
|
||||||
import System.FilePath
|
import System.FilePath ( (</>), takeBaseName )
|
||||||
|
|
||||||
import Model
|
import Model
|
||||||
import Rendering ( render )
|
import Rendering ( render )
|
||||||
|
|
14
app/Model.hs
14
app/Model.hs
|
@ -52,26 +52,12 @@ winCondition world =
|
||||||
where
|
where
|
||||||
coverage = Set.fromList $ map boxLocation $ Map.elems (worldBoxes world)
|
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 -> Int
|
||||||
boxSize world box = yhi-ylo+1
|
boxSize world box = yhi-ylo+1
|
||||||
where
|
where
|
||||||
((ylo,_),(yhi,_)) = bounds (boxWalls world box)
|
((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 -> (Int,Int) -> World
|
||||||
move world dir =
|
move world dir =
|
||||||
case moveBlock world Map.empty (myLocation world) dir 0 of
|
case moveBlock world Map.empty (myLocation world) dir 0 of
|
||||||
|
|
Loading…
Reference in New Issue
Block a user