codingtests/ProjectEuler/015/solve.rb
2012-03-09 10:34:27 +01:00

11 lines
180 B
Ruby

GRID_SIZE = 20
def factorial(num)
if(num == 0)
return 1
else
return num * factorial(num - 1)
end
end
puts factorial(2 * GRID_SIZE) / factorial(GRID_SIZE) ** 2