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

Function demo1

Lib/turtle.py:4137–4188  ·  view source on GitHub ↗

Demo of old turtle.py - module

()

Source from the content-addressed store, hash-verified

4135 pd()
4136
4137 def demo1():
4138 """Demo of old turtle.py - module"""
4139 reset()
4140 tracer(True)
4141 up()
4142 backward(100)
4143 down()
4144 # draw 3 squares; the last filled
4145 width(3)
4146 for i in range(3):
4147 if i == 2:
4148 begin_fill()
4149 for _ in range(4):
4150 forward(20)
4151 left(90)
4152 if i == 2:
4153 color("maroon")
4154 end_fill()
4155 up()
4156 forward(30)
4157 down()
4158 width(1)
4159 color("black")
4160 # move out of the way
4161 tracer(False)
4162 up()
4163 right(90)
4164 forward(100)
4165 right(90)
4166 forward(100)
4167 right(180)
4168 down()
4169 # some text
4170 write("startstart", 1)
4171 write("start", 1)
4172 color("red")
4173 # staircase
4174 for i in range(5):
4175 forward(20)
4176 left(90)
4177 forward(20)
4178 right(90)
4179 # filled staircase
4180 tracer(True)
4181 begin_fill()
4182 for i in range(5):
4183 forward(20)
4184 left(90)
4185 forward(20)
4186 right(90)
4187 end_fill()
4188 # more text
4189
4190 def demo2():
4191 """Demo of some new features."""

Callers 1

turtle.pyFile · 0.85

Calls 6

tracerFunction · 0.85
downClass · 0.85
leftClass · 0.85
rightClass · 0.85
writeFunction · 0.70
upClass · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…