require 'board.rb' #Initialize the board puts "Starting tic tac toe..." b = Board.new() b.display() current_player = 'x' # Let's play! while not b.board_full() and not (result = b.winner()) puts "Asking for Move" b.ask_player_for_move(current_player) current_player = b.get_next_turn() b.display() end #This if statement checks to see if there is a cats game. if (b.board_full() and (result != "o" and result!= "x") ) puts "A cat's game!" else #If there isn't congratulate the winner puts "The game has ended!" puts "Congratulations to #{result}!" end #Just to stop the program from automatically exiting. puts "Press ENTER to exit" gets