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

Method __init__

tools/python-3.11.9-amd64/Lib/turtledemo/nim.py:117–132  ·  view source on GitHub ↗
(self, game)

Source from the content-addressed store, hash-verified

115
116class NimView(object):
117 def __init__(self, game):
118 self.game = game
119 self.screen = game.screen
120 self.model = game.model
121 self.screen.colormode(255)
122 self.screen.tracer(False)
123 self.screen.bgcolor((240, 240, 255))
124 self.writer = turtle.Turtle(visible=False)
125 self.writer.pu()
126 self.writer.speed(0)
127 self.sticks = {}
128 for row in range(3):
129 for col in range(MAXSTICKS):
130 self.sticks[(row, col)] = Stick(row, col, game)
131 self.display("... a moment please ...")
132 self.screen.tracer(True)
133
134 def display(self, msg1, msg2=None):
135 self.screen.tracer(False)

Callers

nothing calls this directly

Calls 6

displayMethod · 0.95
StickClass · 0.85
colormodeMethod · 0.80
tracerMethod · 0.80
bgcolorMethod · 0.45
speedMethod · 0.45

Tested by

no test coverage detected