def draw_char(arr, t: turtle.Pen, scale = 1):
    x, y = get_abs_pos()
    for dx, dy, penup in arr:
        x += dx * scale
        y += dy * scale
        if penup:
            t.penup()
        t.goto(x, y)
        t.pendown()
    std_pos[0] += 1
    t.penup()
    t.goto(get_abs_pos())
    t.pendown()
示例#2
0
def initial():
    global t
    t = Pen()
    t.pensize(1)
    t.pencolor('grey')
    t.hideturtle()
    t.penup()
    for i in range(m + 1):
        t.goto(point_y_up[i])
        t.pendown()
        t.goto(point_y_down[i])
        t.penup()
    for i in range(n + 1):
        t.goto(point_x_le[i])
        t.pendown()
        t.goto(point_x_ri[i])
        t.penup()
示例#3
0
文件: e.py 项目: setayesh1866/scratch
from turtle import Pen
from random import randint

laki = Pen()

def square():
    side = 1
    length = randint(20, 100)
    while side <=4:
        laki.forward(length)
        laki.left(90)
        side += 1

while True:
    laki.speed(1000)
    laki.penup()
    laki.goto(randint(-250, 250), randint(-250, 250))
    laki.pendown()
    laki.begin_fill()
    laki.color("#" + str(randint(100000, 999999)))
    square()
    laki.end_fill()
示例#4
0
def step(t: turtle.Pen):
    t.penup()
    t.forward(i)
    t.left(46)
    t.pendown()
    t.dot(4 + i / 16)