From bc3247a792c6b9b3c91856cc9342baa57c9c39ff Mon Sep 17 00:00:00 2001 From: Bill Ewanick Date: Wed, 18 Oct 2023 23:25:50 -0400 Subject: [PATCH] Flailing with 15 --- src/projectEuler/question15.hs | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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) + +