JDI62ZLKN7J4572C7E2WL2HPGAMFU5YEIDOERVGIOBPOOV3DRF5AC gTPS = 3 ,gInitState = (State { rand = r , center = 0 , input = (Nothing,mempty) } , generate (verse 11) rs) ,
gTPS = 2 ,gInitState = (State { rand = r , center = 0 , input = (Nothing,mempty) , mode = Full } , generate (verse 11) rs) ,
: set Robot { name = "r" , ops = Move <$> cycle [U,N,L] } (shift v 1 U 0): set Robot { name = "g" , ops = Move <$> cycle [N,L,U] } (shift v 2 U 0): set Robot { name = "b" , ops = Move <$> cycle [L,U,N] } (shift v 1 U $ shift v 1 H 0)
: set Robot { name = "t0" , ops = Move <$> cycle [U,N,L] } (shift v 1 U 0): set Robot { name = "t1" , ops = Move <$> cycle [N,L,U] } (shift v 2 U 0): set Robot { name = "t2" , ops = Move <$> cycle [L,U,N] } (shift v 1 U $ shift v 1 H 0)
-- render
-- rendergrapheme :: Unit -> Chargrapheme a| Dumb <- mode s , None <- a = '.'| Dumb <- mode s , Wall <- a = '#'| Dumb <- mode s , Box {} <- a = 'x'| Dumb <- mode s , Ball {} <- a = 'o'| Dumb <- mode s , Robot {} <- a = '@'| Full <- mode s , None <- a = '∙'| Full <- mode s , Wall <- a = '#'| Full <- mode s , Box {} <- a = 'x'| Full <- mode s , Ball {} <- a = 'o'| Full <- mode s , Robot {} <- a = '@'
style :: Unit -> Drawstyle a| Nothing <- move 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 0x99 0x99 0x99 -- #999999
| Dumb <- mode s , me a = color White Dull| Dumb <- mode s , Nothing <- move a = color Black Vivid| Dumb <- mode s , Robot {} <- a , "t0" <- name a = color Blue Dull| Dumb <- mode s , Robot {} <- a , "t1" <- name a = color Magenta Dull| Dumb <- mode s , Robot {} <- a , "t2" <- name a = color Red Dull| Dumb <- mode s , Robot {} <- a , "n" <- name a = color Yellow Dull| Dumb <- mode s , Robot {} <- a , "i" <- name a = color Green Dull| Dumb <- mode s , Robot {} <- a , 'L':_ <- name a = color Cyan Dull| Dumb <- mode s = color White Vivid| Full <- mode s , me a = rgbColor $ sRGB24 0x21 0xb2 0x8e -- #21b28e| Full <- mode s , Nothing <- move a = rgbColor $ sRGB24 0x66 0x66 0x66 -- #666666| Full <- mode s , Robot {} <- a , "t0" <- name a = rgbColor $ sRGB24 0x66 0x66 0x99 -- #666699| Full <- mode s , Robot {} <- a , "t1" <- name a = rgbColor $ sRGB24 0x99 0x66 0x99 -- #996699| Full <- mode s , Robot {} <- a , "t2" <- name a = rgbColor $ sRGB24 0x99 0x66 0x66 -- #996666| Full <- mode s , Robot {} <- a , "n" <- name a = rgbColor $ sRGB24 0x99 0x99 0x66 -- #999966| Full <- mode s , Robot {} <- a , "i" <- name a = rgbColor $ sRGB24 0x66 0x99 0x66 -- #669966| Full <- mode s , Robot {} <- a , 'L':_ <- name a = rgbColor $ sRGB24 0x66 0x99 0x99 -- #669999| Full <- mode s = rgbColor $ sRGB24 0x99 0x99 0x99 -- #999999
demo :: State -> Map Dir Unit -> Unit -> Unitdemo s ns u| me u = me'| Robot {} <- u = u { ops = drop 1 $ ops u }-- | Box {} <- u , Just _ <- pushed u = u { pushed = Nothing }| Box {} <- u = u { pushed = push }| otherwise = u
demo :: Automata State Unitdemo = Automata f
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] }| otherwise = u { ops = [] }
f :: State -> Map Dir Unit -> Unit -> Unitf s ns u| me u = me'| Robot {} <- u = u { ops = drop 1 $ ops u }| Box {} <- u = u { pushed = push }| Ball {} <- u , Nothing <- pushed u = u { pushed = push }| Ball {} <- u , Just _ <- push = u { pushed = push }| Ball {} <- u = u { pushed = Nothing }| otherwise = uwhereme' :: 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] }| otherwise = u { ops = [] }push :: Maybe Dir| [d] <- Map.keys $ Map.filterWithKey (\k w -> move w == Just (opposite k)) ns = Just $ opposite d| otherwise = Nothing
ns :: Map Dir ans = adjacents v i
-- new atoma' :: a| free , [dir] <- mvin = f (adjacents v $ shift v 1 dir i) (adjacents v i Map.! dir)| d : _ <- dest , mfree (memo' IntMap.! d) = void -- move out| otherwise = f (adjacents v i) a
| 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
| Just (_,d) <- floyd $ i : dest = False -- i == d -- floyd $ cycle [0,1] => Just (2,1) , so (i /= d) when reciprocal