python切片教学演示动画_ slice demo animation

"""请更改切片规则,让不同的海龟出列"""

from turtle import *
from random import *

def write_index():
    """在海龟下面写上索引号"""
    i = 0
    # 遍历每只海龟
    for turtle in all_turtles:
        turtle.bk(60)
        rose.goto(turtle.position())
        rose.write(i,font=(None,18,"normal"))
        turtle.fd(60)
        i = i + 1
    
def make_reg(maxnumber):
    """产生一个切片规则"""
    start = randint(0,maxnumber//2)
    end = randint(0,maxnumber)
    step = randint(1,maxnumber//2 - 1 )
    return start,end,step
    
amounts = 10
color_list = ['red','orange','yellow','green','cyan',
              'blue','purple','brown','pink','white']

title = "切片教学演示动画          www.lixingqiu.com"
screen = Screen()
screen.delay(10)
screen.title(title)
screen.bgcolor("black")

You must log in to read the rest of this article. Please log in or register as a user.