1 ! Copyright (c) 2007 Aaron Schaefer.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math math.combinatorics ;
6 ! http://projecteuler.net/index.php?section=problems&id=15
11 ! Starting in the top left corner of a 2x2 grid, there are 6 routes (without
12 ! backtracking) to the bottom right corner.
14 ! How many routes are there through a 20x20 grid?
22 : grid-paths ( n -- n )
27 : euler015 ( -- answer )
30 ! [ euler015 ] 100 ave-time
31 ! 0 ms ave run time - 0.2 SD (100 trials)