diff --git a/notes.md b/notes.md index 67cc9f6..fbfc752 100644 --- a/notes.md +++ b/notes.md @@ -6,13 +6,16 @@ Which class is responsible for each of the following behaviors? For each, explain how the behavior is accomplished. ### Checking to see whether the game is over +game.py is the file, the TTTgame class is responsible for checking whether the game is over. ### Determining which actions are available at a particular state +TTTgame get_next_state() method is generating the list of actions based on the current state. ### Showing the board +TTTview generates the formatting and it is called in get_action() ### Choosing which action to play on a turn - +TTTHuman player class, allows user to play actions base on list of availible actions. ## Checkpoint 2 Notes diff --git a/play_ttt.py b/play_ttt.py index ef5530a..2ecaba1 100644 --- a/play_ttt.py +++ b/play_ttt.py @@ -2,6 +2,9 @@ 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 = TTTHumanPlayer("Player 2") game = TTTGame() @@ -9,6 +12,10 @@ view = TTTView(player0, player1) state = game.get_initial_state() view.greet() + +""" +while loop that checks if game is over if its not... +""" while not game.is_over(state): action = view.get_action(state) state = game.get_next_state(state, action) diff --git a/ttt/player.py b/ttt/player.py index bfbbe15..fb10a01 100644 --- a/ttt/player.py +++ b/ttt/player.py @@ -1,6 +1,6 @@ from click import Choice, prompt from strategy.random_strategy import RandomStrategy -from ttt.game import TTTGame +from ttt.game import TTTGame #may need to delete ttt for this to work import random class TTTHumanPlayer: diff --git a/ttt/view.py b/ttt/view.py index 30df0fd..9e191ae 100644 --- a/ttt/view.py +++ b/ttt/view.py @@ -1,4 +1,4 @@ -from ttt.game import TTTGame +from ttt.game import TTTGame #may need to delete ttt for import click class TTTView: