Submission for tic tac toe lab.

What I changed
I completed checkpoints 1-3. I would have submitted all three separately, but a bug prohibited my initial submissions.
I also started working on the nim section of the lab.

Why I changed it
I made these changes in order to make a functions tic tac toe and nim game.

Estimate for remaining time to finish assignment: 15 minutes
This commit is contained in:
Danielle Tear
2024-02-10 12:01:44 -05:00
parent 8f32985ecb
commit 736cba0006
8 changed files with 94 additions and 14 deletions

View File

@@ -1,10 +1,10 @@
from nim.game_stub import NimGameStub
from nim.game import NimGame
from strategy.lookahead_strategy import LookaheadStrategy
class HumanNimPlayer:
def __init__(self, name):
self.name = name
self.game = NimGameStub()
self.game = NimGame()
def choose_action(self, state):
actions = self.game.get_actions(state)
@@ -26,7 +26,7 @@ class HumanNimPlayer:
class ComputerNimPlayer:
def __init__(self, name):
self.name = name
self.strategy = LookaheadStrategy(NimGameStub(), max_depth=3, deterministic=False)
self.strategy = LookaheadStrategy(NimGame(), max_depth=3, deterministic=False)
def choose_action(self, state):
action = self.strategy.choose_action(state)