Created
September 20, 2014 14:17
-
-
Save mkusher/2fc4e8905f11d1a585d6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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