from turtle import *
from random import *

shape('turtle')
setup(920, 200)
speed(0), hideturtle()
pensize(10)

def p(x, y, u):
    penup(), setpos(x, y)
    pendown(), seth(u)

def uzor_a(x, y, r, c = ""):
    p(x, y - r, 45)
    color(c)
    fd(r), rt(90)
    fd(2*r), rt(90)
    fd(r), rt(90)
    fd(r), rt(90)
    fd(2*r), rt(90)
    fd(r)
    p(x + r * 1.41, y, 45)
    fd(2)

def uzor_b(x, y, r, c = ""):
    p(x + r * 1.41  , y, -45)
    color(c)
    fd(r), rt(90)
    fd(2*r), lt(90)
    fd(r), lt(90)
    fd(r), lt(90)
    fd(2*r), rt(90)
    fd(r)
    p(x, y - r * 1.41, 45)
    fd(2)
    p(x + r * 2.82, y - r * 1.41, 45)
    fd(2)

def uzor_c(x, y, r, c = ""):
    p(x, y - r, 45)
    color(c)
    fd(r), rt(90), fd(2*r)   
    p(x + 0.7 * r, y - r * 1.7, 45)
    fd(2*r), rt(90), fd(r)
    p(x + r * 1.41, y - r * 2.42 , 45)
    fd(2)
    p(x + r * 1.41, y, 45)
    fd(2)

def uzor_d(x, y, r, c = ""):
    p(x + r * 0.7, y - r * 0.6, -135)
    color(c)
    fd(r), lt(90)
    fd(r), lt(90)
    fd(2*r), rt(90)    
    fd(r), rt(90)
    fd(r)
    p(x + r * 1.41, y, 45)
    fd(2)
    p(x + r * 1.41, y - r * 2.42, 45)
    fd(2)

uzor_a(-60, 50, 40, "red")
""" uzor_b(-60, 50, 40, "red")
uzor_c(-60, 50, 40, "red")
uzor_d(-60, 50, 40, "red") """

done()
