Skip to content

Instantly share code, notes, and snippets.

@sllvn
Created June 9, 2012 16:49
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 sllvn/2901752 to your computer and use it in GitHub Desktop.
Save sllvn/2901752 to your computer and use it in GitHub Desktop.
knight = Knight.new(0, 0)
memo = Array.new
1.upto(100000) do |x|
knight.move
knight.move until knight.position == [0, 0]
puts x if x % 100 == 0
memo << knight.count
knight.count = 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment