Код:
import turtle
from math import sin, cos
from random import randint
turtle.setup(800,800)
turtle.colormode(255)
turtle.speed(500)
turtle.bgcolor(0, 0, 0)
def heartx(x):
return 16 * sin(x) ** 3
def hearty(y):
return 13*cos(y) - 5*cos(2*y) \
- 2*cos(3*y) - cos(4*y)
for x in range(500):
turtle.goto(heartx(x) * 20, hearty(x) * 20)
turtle.pencolor(randint(0, 255),
randint(0, 255),
randint(0, 255))
turtle.home()
Олександр Соколов! |