1
0
Fork 0

Flailing with 15

main
Bill Ewanick 2023-10-18 23:25:50 -04:00
parent 9cc718e6b2
commit bc3247a792
1 changed files with 23 additions and 2 deletions

View File

@ -14,10 +14,31 @@ main = print ans
ans = 42 ans = 42
limit = 20 limit = 2
points = [(x,y) | x <- [1..limit], y <- [1..limit]] points = [ (x,y)
| x <- [0..limit]
, y <- [0..limit]
]
data Direction = Right | Down data Direction = Right | Down
move Right (x,y) = (x+1, y ) move Right (x,y) = (x+1, y )
move Down (x,y) = (x , y+1) 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)