MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / demo1

Function demo1

Python/Turtle.py:3884–3935  ·  view source on GitHub ↗

Demo of old turtle.py - module

()

Source from the content-addressed store, hash-verified

3882 pd()
3883
3884 def demo1():
3885 """Demo of old turtle.py - module"""
3886 reset()
3887 tracer(True)
3888 up()
3889 backward(100)
3890 down()
3891 # draw 3 squares; the last filled
3892 width(3)
3893 for i in range(3):
3894 if i == 2:
3895 begin_fill()
3896 for _ in range(4):
3897 forward(20)
3898 left(90)
3899 if i == 2:
3900 color("maroon")
3901 end_fill()
3902 up()
3903 forward(30)
3904 down()
3905 width(1)
3906 color("black")
3907 # move out of the way
3908 tracer(False)
3909 up()
3910 right(90)
3911 forward(100)
3912 right(90)
3913 forward(100)
3914 right(180)
3915 down()
3916 # some text
3917 write("startstart", 1)
3918 write("start", 1)
3919 color("red")
3920 # staircase
3921 for i in range(5):
3922 forward(20)
3923 left(90)
3924 forward(20)
3925 right(90)
3926 # filled staircase
3927 tracer(True)
3928 begin_fill()
3929 for i in range(5):
3930 forward(20)
3931 left(90)
3932 forward(20)
3933 right(90)
3934 end_fill()
3935 # more text
3936
3937 def demo2():
3938 """Demo of some new features."""

Callers 1

Turtle.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected