Skip to content

Instantly share code, notes, and snippets.

@gabrie30
Created November 21, 2014 15:53
Show Gist options
  • Save gabrie30/012b2286a1a72f1625f2 to your computer and use it in GitHub Desktop.
Save gabrie30/012b2286a1a72f1625f2 to your computer and use it in GitHub Desktop.
until tower3 == [3,2,1]
choice_array = moving_from_to_array(tower1, tower2, tower3)
chip_moving = choice_array[0].pop
if chip_moving == nil # if this happens, start again on line 2
puts "You cant do that, try again"
end
choice_array[1].push(chip_moving)
display(tower1, tower2, tower3)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment