Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Created July 18, 2014 21:55
Show Gist options
  • Save pumpkincouture/22f3a7e77204af181951 to your computer and use it in GitHub Desktop.
Save pumpkincouture/22f3a7e77204af181951 to your computer and use it in GitHub Desktop.
#In initialize method
@game_over=false
def third_turn
if win_one
@game_over=true
else
block_one
end
end
def fourth_turn
return if @game_over
block_two unless win_two
end
def fifth_turn
return if @game_over
random_move unless last_win
end
new_game=Game.new("Human", "Tic Tac Toe Warlord")
new_game.second_turn
new_game.third_turn
new_game.fourth_turn
new_game.fifth_turn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment