Skip to content

Instantly share code, notes, and snippets.

Created June 8, 2016 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c67bd49fbd6b5727f3efd71dcefdda49 to your computer and use it in GitHub Desktop.
Save anonymous/c67bd49fbd6b5727f3efd71dcefdda49 to your computer and use it in GitHub Desktop.
def runner( x, y, size )
if x == size && y == size
puts "Path found"
end
unless x + 1 > size
runner( x + 1, y, size )
end
unless y + 1 > size
runner( x, y + 1, size )
end
end
runner( 0 , 0, 20 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment