Tidying day 13
[advent-of-code-18.git] / src / advent13 / advent13.hs
index c1bf4d8eb4e04055ac0333109ab36f1caa2af663..7e5c7f3d98fe5f1b453998c01b71482c61343cf3 100644 (file)
@@ -1,13 +1,12 @@
 {-# LANGUAGE OverloadedStrings #-}
 
-
 import Prelude hiding (Left, Right)
 import Data.List
 import Data.Tuple (swap)
 import qualified Data.Map.Strict as M
 import Data.Map.Strict ((!))
 
-import Debug.Trace
+-- import Debug.Trace
 
 type Coord = (Int, Int) -- x, y
 data Cell = Horizontal | Vertical | TopLeft | TopRight | Junction deriving (Show, Eq)
@@ -17,18 +16,13 @@ data Cart = Cart Direction Decision deriving (Eq, Show)
 type Layout = M.Map Coord Cell
 type Carts = M.Map Coord Cart
 
-
 main :: IO ()
 main = do 
     text <- readFile "data/advent13.txt"
     let (layout, carts) = parse text
-    -- print carts
-    -- print layout
-    -- print $ propogateUntilCollision (orderedCarts carts) layout carts
     putStrLn $ showCoord $ part1 carts layout
     putStrLn $ showCoord $ part2 carts layout
 
-
 part1 :: Carts -> Layout -> Coord
 part1 carts layout = collisionSite
     where (collisionSite, _, _, _) = propogateUntilCollision (orderedCarts carts) layout carts