Counting Path of Robot Motion
Given a 8 by 8 grid and a robot that moves from the left bottom corner (0, 0) to the right top corner (7, 7) by stepping either right (East) or upward (North) in total 14 steps, find all possible paths.
A sample solution:
def C(i, j) if i == 0 ["N"*j] elsif j == 0 ["E"*i] else C(i-1, j).map{|c| c+"E"} + C(i, j-1).map{|c| c+"N"} end end p C(7,7)