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

Method move

Lib/turtledemo/nim.py:64–76  ·  view source on GitHub ↗
(self, row, col)

Source from the content-addressed store, hash-verified

62 self.game.state = Nim.RUNNING
63
64 def move(self, row, col):
65 maxspalte = self.sticks[row]
66 self.sticks[row] = col
67 self.game.view.notify_move(row, col, maxspalte, self.player)
68 if self.game_over():
69 self.game.state = Nim.OVER
70 self.winner = self.player
71 self.game.view.notify_over()
72 elif self.player == 0:
73 self.player = 1
74 row, col = computerzug(self.sticks)
75 self.move(row, col)
76 self.player = 0
77
78 def game_over(self):
79 return self.sticks == [0, 0, 0]

Callers 1

notify_moveMethod · 0.95

Calls 4

game_overMethod · 0.95
computerzugFunction · 0.85
notify_overMethod · 0.80
notify_moveMethod · 0.45

Tested by

no test coverage detected