How many such routes are there through a 20×20 grid?

- Code: Select all
`// Here, we are looking for n paths from 2n possibilities, so C(2n, n)`

// So : (2n)*(2n-1)*... *(n+1) / ( 1*2*... n)

: pe015(n) // ( n -- n ) : Returns number of paths for a nxn grid

{

| i |

1 n loop: i [ 2 n * i - 1 + * i / ]

}