board-games-0.4: Three games for inclusion in a web server
Safe HaskellNone
LanguageHaskell2010

Game.Labyrinth

Synopsis

Documentation

>>> import qualified Game.Labyrinth as Labyrinth

newtype Board Source #

Constructors

Board Word64 

Instances

Instances details
Arbitrary Board Source # 
Instance details

Defined in Game.Labyrinth

Methods

arbitrary :: Gen Board #

shrink :: Board -> [Board] #

Monoid Board Source # 
Instance details

Defined in Game.Labyrinth

Methods

mempty :: Board #

mappend :: Board -> Board -> Board #

mconcat :: [Board] -> Board #

Semigroup Board Source # 
Instance details

Defined in Game.Labyrinth

Methods

(<>) :: Board -> Board -> Board #

sconcat :: NonEmpty Board -> Board #

stimes :: Integral b => b -> Board -> Board #

Show Board Source # 
Instance details

Defined in Game.Labyrinth

Methods

showsPrec :: Int -> Board -> ShowS #

show :: Board -> String #

showList :: [Board] -> ShowS #

Eq Board Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Board -> Board -> Bool #

(/=) :: Board -> Board -> Bool #

data Coord Source #

Constructors

C0 
C1 
C2 
C3 
C4 
C5 
C6 

Instances

Instances details
Arbitrary Coord Source # 
Instance details

Defined in Game.Labyrinth

Methods

arbitrary :: Gen Coord #

shrink :: Coord -> [Coord] #

Bounded Coord Source # 
Instance details

Defined in Game.Labyrinth

Enum Coord Source # 
Instance details

Defined in Game.Labyrinth

Show Coord Source # 
Instance details

Defined in Game.Labyrinth

Methods

showsPrec :: Int -> Coord -> ShowS #

show :: Coord -> String #

showList :: [Coord] -> ShowS #

Eq Coord Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Coord -> Coord -> Bool #

(/=) :: Coord -> Coord -> Bool #

Ord Coord Source # 
Instance details

Defined in Game.Labyrinth

Methods

compare :: Coord -> Coord -> Ordering #

(<) :: Coord -> Coord -> Bool #

(<=) :: Coord -> Coord -> Bool #

(>) :: Coord -> Coord -> Bool #

(>=) :: Coord -> Coord -> Bool #

max :: Coord -> Coord -> Coord #

min :: Coord -> Coord -> Coord #

allEnums :: (Enum a, Bounded a) => [a] Source #

(.-.) :: Bits a => a -> a -> a infixl 7 Source #

shiftRowLeft :: Coord -> (Bool, Board) -> (Bool, Board) Source #

\k b -> b == Labyrinth.shiftRowLeft k (Labyrinth.shiftRowRight k b)
\k b -> b == Labyrinth.shiftRowRight k (Labyrinth.shiftRowLeft k b)

shiftColumnUp :: Coord -> (Bool, Board) -> (Bool, Board) Source #

\k b -> b == Labyrinth.shiftColumnUp k (Labyrinth.shiftColumnDown k b)
\k b -> b == Labyrinth.shiftColumnDown k (Labyrinth.shiftColumnUp k b)

cycleGen :: (Board -> Board) -> (Coord -> Word64) -> Coord -> Board -> Board Source #

cycleRowLeft :: Coord -> Board -> Board Source #

\k b -> b == Labyrinth.cycleRowLeft k (Labyrinth.cycleRowRight k b)
\k b -> b == Labyrinth.cycleRowRight k (Labyrinth.cycleRowLeft k b)

cycleColumnUp :: Coord -> Board -> Board Source #

\k b -> b == Labyrinth.cycleColumnUp k (Labyrinth.cycleColumnDown k b)
\k b -> b == Labyrinth.cycleColumnDown k (Labyrinth.cycleColumnUp k b)

data Directions a Source #

Constructors

Directions 

Fields

Instances

Instances details
Foldable Directions Source # 
Instance details

Defined in Game.Labyrinth

Methods

fold :: Monoid m => Directions m -> m #

foldMap :: Monoid m => (a -> m) -> Directions a -> m #

foldMap' :: Monoid m => (a -> m) -> Directions a -> m #

foldr :: (a -> b -> b) -> b -> Directions a -> b #

foldr' :: (a -> b -> b) -> b -> Directions a -> b #

foldl :: (b -> a -> b) -> b -> Directions a -> b #

foldl' :: (b -> a -> b) -> b -> Directions a -> b #

foldr1 :: (a -> a -> a) -> Directions a -> a #

foldl1 :: (a -> a -> a) -> Directions a -> a #

toList :: Directions a -> [a] #

null :: Directions a -> Bool #

length :: Directions a -> Int #

elem :: Eq a => a -> Directions a -> Bool #

maximum :: Ord a => Directions a -> a #

minimum :: Ord a => Directions a -> a #

sum :: Num a => Directions a -> a #

product :: Num a => Directions a -> a #

Traversable Directions Source # 
Instance details

Defined in Game.Labyrinth

Methods

traverse :: Applicative f => (a -> f b) -> Directions a -> f (Directions b) #

sequenceA :: Applicative f => Directions (f a) -> f (Directions a) #

mapM :: Monad m => (a -> m b) -> Directions a -> m (Directions b) #

sequence :: Monad m => Directions (m a) -> m (Directions a) #

Applicative Directions Source # 
Instance details

Defined in Game.Labyrinth

Methods

pure :: a -> Directions a #

(<*>) :: Directions (a -> b) -> Directions a -> Directions b #

liftA2 :: (a -> b -> c) -> Directions a -> Directions b -> Directions c #

(*>) :: Directions a -> Directions b -> Directions b #

(<*) :: Directions a -> Directions b -> Directions a #

Functor Directions Source # 
Instance details

Defined in Game.Labyrinth

Methods

fmap :: (a -> b) -> Directions a -> Directions b #

(<$) :: a -> Directions b -> Directions a #

Monoid a => Monoid (Directions a) Source # 
Instance details

Defined in Game.Labyrinth

Semigroup a => Semigroup (Directions a) Source # 
Instance details

Defined in Game.Labyrinth

Eq a => Eq (Directions a) Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Directions a -> Directions a -> Bool #

(/=) :: Directions a -> Directions a -> Bool #

boxTable :: [[Box]] -> Box Source #

constMap :: Ord k => [k] -> a -> Map k a Source #

data Shape Source #

Constructors

I 
L 
T 

Instances

Instances details
Enum Shape Source # 
Instance details

Defined in Game.Labyrinth

Show Shape Source # 
Instance details

Defined in Game.Labyrinth

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

Eq Shape Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Shape -> Shape -> Bool #

(/=) :: Shape -> Shape -> Bool #

Ord Shape Source # 
Instance details

Defined in Game.Labyrinth

Methods

compare :: Shape -> Shape -> Ordering #

(<) :: Shape -> Shape -> Bool #

(<=) :: Shape -> Shape -> Bool #

(>) :: Shape -> Shape -> Bool #

(>=) :: Shape -> Shape -> Bool #

max :: Shape -> Shape -> Shape #

min :: Shape -> Shape -> Shape #

data Rotation Source #

Constructors

R0 
R1 
R2 
R3 

grid :: [a] -> [(a, a)] Source #

data Player Source #

Constructors

Player0 
Player1 
Player2 
Player3 

Instances

Instances details
Bounded Player Source # 
Instance details

Defined in Game.Labyrinth

Enum Player Source # 
Instance details

Defined in Game.Labyrinth

Show Player Source # 
Instance details

Defined in Game.Labyrinth

Eq Player Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Player -> Player -> Bool #

(/=) :: Player -> Player -> Bool #

Ord Player Source # 
Instance details

Defined in Game.Labyrinth

removeFromMap :: Ord k => k -> Map k a -> (Maybe a, Map k a) Source #

insertMaybeMap :: Ord k => k -> Maybe a -> Map k a -> Map k a Source #

shiftPlayersGen :: Eq a => (b -> a) -> (b -> b) -> a -> EnumMap k b -> EnumMap k b Source #

cyclicPred :: (Eq a, Enum a, Bounded a) => a -> a Source #

cyclicSucc :: (Eq a, Enum a, Bounded a) => a -> a Source #

data Border Source #

Constructors

North 
West 
South 
East 

Instances

Instances details
Bounded Border Source # 
Instance details

Defined in Game.Labyrinth

Enum Border Source # 
Instance details

Defined in Game.Labyrinth

Show Border Source # 
Instance details

Defined in Game.Labyrinth

Eq Border Source # 
Instance details

Defined in Game.Labyrinth

Methods

(==) :: Border -> Border -> Bool #

(/=) :: Border -> Border -> Bool #

Ord Border Source # 
Instance details

Defined in Game.Labyrinth

main :: IO () Source #