实验6

from turtle import *
def square(size=50, rgb = 'orange'):
    pencolor(rgb)
    for i in range(4):
        fd(size)
        left(90)

def main():
    setup(800, 600)
    speed(0)
    for i in range(11):
        square(80)
        left(360/11)
    hideturtle()
    done()
if __name__ == '__main__':
    main()

实验6

from turtle import *
setup(800, 600)
pencolor('pink')
for i in range(9):
    for i in range(2):
        circle(80, 90)
        left(90)
    right(40)
hideturtle()
done()

实验6

from turtle import *
speed(0)
setup(800, 600)
bgcolor('black')
pencolor('white')
angle = 0
size = 2
for i in range(10):
    for j in range(4):
        fd(size)
        angle += 360/5
        seth(angle)
        size += 5
hideturtle()
done()

实验6

from turtle import *
from random import random
from typing import Sequence
def square(rgb):
    color(rgb)
    begin_fill()
    for i in range(4):
        fd(20*(i%2+1))
        left(90)
    end_fill()

def moveto(x,y):
    penup()
    goto(x,y)
    pendown()

def main():
    setup(800, 600)
    speed(0)
    for distance in range(180, -180, -20):
        moveto(-distance, 0)
        rgb = tuple(random() for i in range(3))
        square(rgb)
    hideturtle()
    done()
if __name__ == '__main__':
    main()

实验6

上一篇:js中replace的第二个参数是函数的情况应用


下一篇:ScanNet: Richly-annotated 3D Reconstructions of Indoor Scenes摘要和简介翻译