-
-
Save gabrie30/012b2286a1a72f1625f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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