diff --git a/notes.md b/notes.md index 75c8ae2..22fac4f 100644 --- a/notes.md +++ b/notes.md @@ -37,4 +37,5 @@ For the first one, I would put an X on the rightmost cell in the middle row. Thi You can get the inital game state using game.get_initial_state(). What is the current and future reward for this state? What does this mean? +The current and future reward for this state is 1. This means the state favors player X assuming both players continue using the same look ahead strategy. diff --git a/play_ttt.py b/play_ttt.py index ef5530a..1b78ace 100644 --- a/play_ttt.py +++ b/play_ttt.py @@ -2,8 +2,8 @@ from ttt.game import TTTGame from ttt.view import TTTView from ttt.player import TTTHumanPlayer, TTTComputerPlayer -player0 = TTTHumanPlayer("Player 1") -player1 = TTTHumanPlayer("Player 2") +player0 = TTTHumanPlayer("Pleayer 1") +player1 = TTTComputerPlayer("Robot 1") game = TTTGame() view = TTTView(player0, player1) diff --git a/ttt/player.py b/ttt/player.py index bfbbe15..e955b98 100644 --- a/ttt/player.py +++ b/ttt/player.py @@ -1,4 +1,5 @@ from click import Choice, prompt +from strategy.lookahead_strategy import LookaheadStrategy from strategy.random_strategy import RandomStrategy from ttt.game import TTTGame import random @@ -24,7 +25,7 @@ class TTTComputerPlayer: def __init__(self, name): "Sets up the player." self.name = name - self.strategy = RandomStrategy(TTTGame()) + self.strategy = LookaheadStrategy(TTTGame(),deterministic=False) def choose_action(self, state): "Chooses a random move from the moves available."