Last active
August 29, 2015 14:06
-
-
Save dubilla/4a2d483f975512f2918c 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
# Player 1 plays 0s | |
# Player 2 plays 1s | |
if item.even? | |
box[move] = 'X' | |
elsif item.odd? | |
box[move] = '0' | |
end | |
# Did player 1 win? | |
if item.odd? and item > 3 and player_winner?(box, '0') | |
puts "#{player1} won! Congrats" | |
return | |
end | |
if item.even? and item > 3 and player_winner?(box, 'X') | |
puts "#{player2} won! Congrats" | |
return | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment