MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / set

Method set

tools/python-3.11.9-amd64/Tools/demo/life.py:62–66  ·  view source on GitHub ↗

Set a cell to the live state

(self, y, x)

Source from the content-addressed store, hash-verified

60 self.scr.refresh()
61
62 def set(self, y, x):
63 """Set a cell to the live state"""
64 if x < 0 or self.X <= x or y < 0 or self.Y <= y:
65 raise ValueError("Coordinates out of range %i,%i" % (y, x))
66 self.state[x, y] = 1
67
68 def toggle(self, y, x):
69 """Toggle a cell's state between live and dead"""

Callers 2

make_randomMethod · 0.95
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected