实验8

1

 1 from turtle import *
 2 
 3 def square(size=50, rgb='orange'):
 4     pencolor(rgb)
 5     for i in range(4):
 6         fd(size)
 7         left(90)
 8 
 9 def main():
10     setup(800,600)
11     speed(0)
12 
13     n=10
14     for i in range (n):
15         square(80)
16         left(360/n)
17 
18     hideturtle()
19     done()
20 
21 if __name__=='__main__':
22 
23     main()

 

 

2

from turtle import*

setup(800,600)
pencolor('pink')
speed(0)

n=10

for i in range(n):

    for j in range (2):
        circle(80,90)
        left(90)
    right(360/n)

hideturtle()
done()

 

3

from turtle import *

setup(800, 600)
bgcolor('black')
pencolor('white')
speed(0)

angle = 0
size = 2

n = 10
for i in range(n):
    for j in range(4):
        fd(size)
        angle += 72
        seth(angle)
        size += 5
hideturtle()
done()

 

 

4

from turtle import *

setup(800, 600)
bgcolor('black')
pencolor('white')
speed(0)

angle = 0
size = 2

n = 10
for i in range(n):
    for j in range(4):
        fd(size)
        angle += 72
        seth(angle)
        size += 5
hideturtle()
done()

 

posted @ 2022-06-13 22:20  张满月的衣橱  阅读(8)  评论(0编辑  收藏  举报