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

Function computerzug

Lib/turtledemo/nim.py:31–39  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

29 return random.randint(MINSTICKS, MAXSTICKS)
30
31def computerzug(state):
32 xored = state[0] ^ state[1] ^ state[2]
33 if xored == 0:
34 return randommove(state)
35 for z in range(3):
36 s = state[z] ^ xored
37 if s <= state[z]:
38 move = (z, s)
39 return move
40
41def randommove(state):
42 m = max(state)

Callers 1

moveMethod · 0.85

Calls 1

randommoveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…