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

Function randommove

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

Source from the content-addressed store, hash-verified

39 return move
40
41def randommove(state):
42 m = max(state)
43 while True:
44 z = random.randint(0,2)
45 if state[z] > (m > 1):
46 break
47 rand = random.randint(m > 1, state[z]-1)
48 return z, rand
49
50
51class NimModel(object):

Callers 1

computerzugFunction · 0.85

Calls 1

randintMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…