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

Function demo1

tools/python-3.11.9-amd64/Lib/turtle.py:4003–4054  ·  view source on GitHub ↗

Demo of old turtle.py - module

()

Source from the content-addressed store, hash-verified

4001 pd()
4002
4003 def demo1():
4004 """Demo of old turtle.py - module"""
4005 reset()
4006 tracer(True)
4007 up()
4008 backward(100)
4009 down()
4010 # draw 3 squares; the last filled
4011 width(3)
4012 for i in range(3):
4013 if i == 2:
4014 begin_fill()
4015 for _ in range(4):
4016 forward(20)
4017 left(90)
4018 if i == 2:
4019 color("maroon")
4020 end_fill()
4021 up()
4022 forward(30)
4023 down()
4024 width(1)
4025 color("black")
4026 # move out of the way
4027 tracer(False)
4028 up()
4029 right(90)
4030 forward(100)
4031 right(90)
4032 forward(100)
4033 right(180)
4034 down()
4035 # some text
4036 write("startstart", 1)
4037 write("start", 1)
4038 color("red")
4039 # staircase
4040 for i in range(5):
4041 forward(20)
4042 left(90)
4043 forward(20)
4044 right(90)
4045 # filled staircase
4046 tracer(True)
4047 begin_fill()
4048 for i in range(5):
4049 forward(20)
4050 left(90)
4051 forward(20)
4052 right(90)
4053 end_fill()
4054 # more text
4055
4056 def demo2():
4057 """Demo of some new features."""

Callers 1

turtle.pyFile · 0.85

Calls 2

resetFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected