generated from mwc/lab_tic_tac_toe
(Commit summary. Replace this with a one-line description of this commit.)
completing notes md What I changed (Replace this with a description of what you changed in this commit. This should be 1-2 sentences.) changed descriptions Why I changed it (Describe why you made these changes. Were you working toward a goal? Did you reorganize your code? This should be 1-2 sentences.) Checkpoint 1 goal Estimate for remaining time to finish assignment: [3 days]
This commit is contained in:
parent
82c43d634b
commit
4e30fd8a26
5
notes.md
5
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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from ttt.game import TTTGame
|
||||
from ttt.game import TTTGame #may need to delete ttt for
|
||||
import click
|
||||
|
||||
class TTTView:
|
||||
|
|
Loading…
Reference in New Issue