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

Method make_random

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

Fill the board with a random pattern

(self)

Source from the content-addressed store, hash-verified

133 self.scr.refresh()
134
135 def make_random(self):
136 "Fill the board with a random pattern"
137 self.state = {}
138 for i in range(0, self.X):
139 for j in range(0, self.Y):
140 if random.random() > 0.5:
141 self.set(j, i)
142
143
144def erase_menu(stdscr, menu_y):

Callers 1

keyloopFunction · 0.95

Calls 2

setMethod · 0.95
randomMethod · 0.80

Tested by

no test coverage detected