ANAAF3LVFG2YCTAWUZKMT75XQN6YNS4CLLZIXSVGKJQRWJVNBMEAC style :: Draw| None <- a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Wall <- a = rgbColor $ sRGB24 0x99 0x99 0x99 -- #999999| Box <- a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Robot {} <- a , "@" <- name a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Robot {} <- a , "r" <- name a = rgbColor $ sRGB24 0x99 0x66 0x66 -- #996666| Robot {} <- a , "g" <- name a = rgbColor $ sRGB24 0x66 0x99 0x66 -- #669966| Robot {} <- a , "b" <- name a = rgbColor $ sRGB24 0x66 0x66 0x99 -- #666699| Robot {} <- a , "n" <- name a = rgbColor $ sRGB24 0x99 0x99 0x66 -- #999966| Robot {} <- a , "i" <- name a = rgbColor $ sRGB24 0x66 0x99 0x99 -- #669999| otherwise = rgbColor $ sRGB24 0x66 0x66 0x66
hex :: Planehex = foldl (&) canvas [ write (x,y) | x <- [-r..r] , y <- [-r..r] , abs (x + y) <= r ]
scope :: [Int] -> Planescope n| i : _ <- n = foldl (&) (blankPlane 5 3)[ (1,2) % let a = adjacents v i Map.! U in cell (grapheme a) # style a, (1,4) % let a = adjacents v i Map.! I in cell (grapheme a) # style a, (2,1) % let a = adjacents v i Map.! H in cell (grapheme a) # style a, (2,3) % let a = node v i in cell (grapheme a), (2,5) % let a = adjacents v i Map.! L in cell (grapheme a) # style a, (3,2) % let a = adjacents v i Map.! N in cell (grapheme a) # style a, (3,4) % let a = adjacents v i Map.! M in cell (grapheme a) # style a]| otherwise = blankPlane 5 3-- rendergrapheme :: Unit -> Chargrapheme a| None <- a = '∙'| Wall <- a = '#'| Box <- a = 'o'| Robot {} <- a = '@'style :: Unit -> Drawstyle a| None <- a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Wall <- a = rgbColor $ sRGB24 0x99 0x99 0x99 -- #999999| Box <- a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Robot {} <- a , "@" <- name a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Robot {} <- a , "r" <- name a = rgbColor $ sRGB24 0x66 0x66 0x99 -- #666699| Robot {} <- a , "g" <- name a = rgbColor $ sRGB24 0x99 0x66 0x99 -- #996699| Robot {} <- a , "b" <- name a = rgbColor $ sRGB24 0x99 0x66 0x66 -- #996666| Robot {} <- a , "n" <- name a = rgbColor $ sRGB24 0x99 0x99 0x66 -- #999966| Robot {} <- a , "i" <- name a = rgbColor $ sRGB24 0x66 0x99 0x66 -- #669966| Robot {} <- a , 'L':_ <- name a = rgbColor $ sRGB24 0x66 0x99 0x99 -- #669999| otherwise = rgbColor $ sRGB24 0x66 0x66 0x66
me'| Just 'h' <- fst $ keys s = u { ops = [Move H] }| Just 'j' <- fst $ keys s = u { ops = [Move N] }| Just 'k' <- fst $ keys s = u { ops = [Move I] }| Just 'l' <- fst $ keys s = u { ops = [Move L] }
me' :: Unit| Just 'h' <- fst $ input s = u { ops = [Move H] }| Just 'j' <- fst $ input s = u { ops = [Move N] }| Just 'k' <- fst $ input s = u { ops = [Move I] }| Just 'l' <- fst $ input s = u { ops = [Move L] }
| Just (_,d) <- floyd $ i : dest = i == d -- loops back to itself , floyd $ cycle [0,1] => Just (2,1) , so (i /= d) which means stall when reciprocal)
| Just (_,d) <- floyd $ i : dest = False -- i == d -- loops back to itself , floyd $ cycle [0,1] => Just (2,1) , so (i /= d) which means stall when reciprocal)-- ^temporary