summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--6-2.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/6-2.hs b/6-2.hs
index 5153fb8..835bb23 100644
--- a/6-2.hs
+++ b/6-2.hs
@@ -50,9 +50,10 @@ checkAhead :: Map -> Vel -> Coords -> Bool
checkAhead m = (((== Free) . sub m) .) . move
turn :: Vel -> Coords -> (Coords, Vel)
-turn v p = let rot (Coords x y) = Coords (-y) x
- v' = rot v
- in (move v' p, v')
+turn v p =
+ let rot (Coords x y) = Coords (-y) x
+ v' = rot v
+ in (p, v')
step :: Map -> Vel -> Coords -> (Coords, Vel)
step m v p = if checkAhead m v p
@@ -103,6 +104,4 @@ main = do
let path = map fst $ execState (run m v p) []
let ms = possibilities m $ nub path
let res = ms `pseq` (map (\ n -> evalState (run n v p) []) ms `using` parList rdeepseq)
--- putStr . unlines . intersperse "--" . map (showMap . fst) . filter snd . zip ms $ res
print . length . filter id $ res
--- print . length $ ms