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
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)