1
0
Fork 0

Start of 15

main
Bill Ewanick 2023-10-14 16:41:29 -04:00
parent 6bee470b8a
commit b0e3c4a87d
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
{-
https://projecteuler.net/problem=15
Starting in the top left corner of a 2x2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
How many such routes are there through a 20x20 grid?
-}
module Main where
import Prelude hiding (Right)
main :: IO ()
main = print ans
ans = 42
limit = 20
points = [(x,y) | x <- [1..limit], y <- [1..limit]]
data Direction = Right | Down
move Right (x,y) = (x+1, y )
move Down (x,y) = (x , y+1)