Skip to content

Instantly share code, notes, and snippets.

@dubilla
Last active August 29, 2015 14:06
Show Gist options
  • Save dubilla/4a2d483f975512f2918c to your computer and use it in GitHub Desktop.
Save dubilla/4a2d483f975512f2918c to your computer and use it in GitHub Desktop.
# 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