diff --git a/src/projectEuler/question15.hs b/src/projectEuler/question15.hs index 94d7c7d..4a9f5ed 100644 --- a/src/projectEuler/question15.hs +++ b/src/projectEuler/question15.hs @@ -14,10 +14,31 @@ main = print ans ans = 42 -limit = 20 -points = [(x,y) | x <- [1..limit], y <- [1..limit]] +limit = 2 +points = [ (x,y) + | x <- [0..limit] + , y <- [0..limit] + ] data Direction = Right | Down move Right (x,y) = (x+1, y ) move Down (x,y) = (x , y+1) + +-- solve :: (Int, Int) -> [[(Int, Int)]] +{- +λ> [(0,0)] +[(0,0)] +λ> [(0,0),(1,0),(2,0),(2,1),(2,2)] +[(0,0),(1,0),(2,0),(2,1),(2,2)] +λ> [ [(0,0),(1,0),(2,0),(2,1),(2,2)], [(0,0),(1,0),(1,1),(2,1),(2,2)]] +[[(0,0),(1,0),(2,0),(2,1),(2,2)],[(0,0),(1,0),(1,1),(2,1),(2,2)]] +λ> +-} + +data Tree a + = Leaf a + | Branch (Tree a) (Tree a) + deriving (Show) + +