generated from mwc/lab_tic_tac_toe
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user