generated from mwc/lab_tic_tac_toe
Completed checkpoint 3
What I changed (I gave the computer player the look ahead strategy. This also required importing LookaheadStrategy in player.py. I also answered the questions in notes.md.) Why I changed it (I was working on completing checkpoint 3. I realized I had to do the importing since otherwise it wouldn't let me play.) Estimate for remaining time to finish assignment: [I am REALLY bad at these estimates. I mean in terms of actual work time, I'm probably not too far off. Fingers crossed, maybe another hour of actual work time?]
This commit is contained in:
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user