import math import turtle import time class my_turtle: def __init__(self, x, y): self.x = 0 self.y = 0 self.direction = 0 self.turtle = turtle.Turtle() def left(self, angle): self.direction -= angle def right(self, angle): self.direction += angle def forward(self, distance): self.x += distance * math.cos(self.direction * math.pi / 180) self.y += distance * math.sin(self.direction * math.pi / 180) def draw(self): self.turtle.dot(10) #1. vytvorte korytnacku turtle.clearscreen() #2. vykreslite korytnacku time.sleep(0.3) turtle.mainloop()