Completed the tasks for checkpoint 3

What I changed
Answered the questions and gave the computer a better strategy.

Why I changed it
I answered the questions to the best of my abilitiy. I gave the computer a better strategy as instructed.

Estimate for remaining time to finish assignment: 30 minutes
This commit is contained in:
root
2024-02-14 23:44:21 -05:00
parent ca1c558686
commit f5b1b03b9a
3 changed files with 10 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
from click import Choice, prompt
from strategy.random_strategy import RandomStrategy
from strategy.lookahead_strategy import LookaheadStrategy
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."