Skip to content

Instantly share code, notes, and snippets.

@mkusher
Created September 20, 2014 14:17
Show Gist options
  • Select an option

  • Save mkusher/2fc4e8905f11d1a585d6 to your computer and use it in GitHub Desktop.

Select an option

Save mkusher/2fc4e8905f11d1a585d6 to your computer and use it in GitHub Desktop.
data Coords = Coords { x :: Integer
, y :: Integer
} deriving (Show)
data Relation = Relation Coords Coords deriving (Show)
data Vertex = Vertex { top :: Bool
, right :: Bool
, bottom :: Bool
, left :: Bool
} deriving (Show)
data Labirint = Labirint [[Vertex]] deriving (Show)
data Direction = Direction Bool Bool
getCurrentWay :: Coords -> Direction
getCurrentWay c | c.x > c.y = Direction False True
| c.x < c.y = Direction True False
| True = Direction True True
generate :: Integer -> Integer -> Labirint
generate a b = Labirint [[Vertex False False False False] | x <- [1..a], y <- [1..b]]
run :: Integer -> Integer -> Labirint
run a b = generate a b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment