Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Last active August 29, 2015 14:05
Show Gist options
  • Save pumpkincouture/5503237dbc4a9733c4b5 to your computer and use it in GitHub Desktop.
Save pumpkincouture/5503237dbc4a9733c4b5 to your computer and use it in GitHub Desktop.
player = ui.choice
if player == "E"
player = computer_player
else
player = intel_computer_player
end
ui.welcome(board.cells, player)
until new_game.game_over?(board.cells)
human_player.user_turn(ui)
if board.invalid_key(human_player.answer)
ui.user_error
else
board.valid_move(human_player.answer)
player.possible_moves(board.cells)
board.computer_move(player.computer_move(player.possible_moves(board.cells)))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment