Implement p0 tutorial.

This commit is contained in:
2021-10-11 21:01:31 -04:00
parent a95016431f
commit cd948fe640
15 changed files with 165 additions and 159 deletions

View File

@@ -37,7 +37,7 @@ class NullGraphics:
time.sleep(SLEEP_TIME)
def draw(self, state):
print state
print(state)
def updateDistributions(self, dist):
pass
@@ -64,7 +64,7 @@ class PacmanGraphics:
self.turn += 1
if DISPLAY_MOVES:
ghosts = [pacman.nearestPoint(state.getGhostPosition(i)) for i in range(1, numAgents)]
print "%4d) P: %-8s" % (self.turn, str(pacman.nearestPoint(state.getPacmanPosition()))),'| Score: %-5d' % state.score,'| Ghosts:', ghosts
print("%4d) P: %-8s" % (self.turn, str(pacman.nearestPoint(state.getPacmanPosition()))),'| Score: %-5d' % state.score,'| Ghosts:', ghosts)
if self.turn % DRAW_EVERY == 0:
self.draw(state)
self.pause()
@@ -75,7 +75,7 @@ class PacmanGraphics:
time.sleep(SLEEP_TIME)
def draw(self, state):
print state
print(state)
def finish(self):
pass