#3 Hello Turtles
import turtle
sc = turtle.Screen();
sc.bgcolor("lightgreen")
sc.title("Hello World");
ai = turtle.Turtle();
ai.color("pink");
ai.shape("turtle");
ai.pensize(5);
ai.speed(0); #does not show process;
ai.speed(1);
ai.hideturtle() #hide
ai.forward(20);
ai.left(90); # turn by degrees not radian!
ai.forward(20);
ai.right(90);
ai.forward(20);
ai.stamp(); # mark
ai.penup(); # not draw line
ai.forward(50);
ai.pendown(); # resume
ai.showturtle() # show
sc.mainloop(); # suspend
魔性的 turtle 入门
最新推荐文章于 2024-01-04 17:25:38 发布