MCPcopy Index your code
hub / github.com/python/cpython / NimController

Class NimController

Lib/turtledemo/nim.py:182–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180
181
182class NimController(object):
183
184 def __init__(self, game):
185 self.game = game
186 self.sticks = game.view.sticks
187 self.BUSY = False
188 for stick in self.sticks.values():
189 stick.onclick(stick.makemove)
190 self.game.screen.onkey(self.game.model.setup, "space")
191 self.game.screen.onkey(self.game.view.clear, "Escape")
192 self.game.view.display("Press space bar to start game")
193 self.game.screen.listen()
194
195 def notify_move(self, row, col):
196 if self.BUSY:
197 return
198 self.BUSY = True
199 self.game.model.notify_move(row, col)
200 self.BUSY = False
201
202
203class Nim(object):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…