lab_tic_tac_toe/play_ttt.py

26 lines
630 B
Python

from ttt.game import TTTGame
from ttt.view import TTTView
from ttt.player import TTTHumanPlayer, TTTComputerPlayer
'''
creates new player0, player1, game and view objects?
'''
player0 = TTTHumanPlayer("Player 1")
player1 = TTTComputerPlayer("Player 2")
game = TTTGame()
view = TTTView(player0, player1)
#creates initial state
state = game.get_initial_state()
view.greet()
"""
while loop that checks if game is over if its not...
"""
#gets passed blank board
while not game.is_over(state):
#take action and update board
action = view.get_action(state)
state = game.get_next_state(state, action)
view.conclude(state)