Simple Python Turtle Graphic and Code: Intersection Sign
The traffic sign for intersection created with overlapping squares and an x. The overlapping squares produce a black lining near the edges while the x, in proper rotation, represents crossed roads. The simple Python Turtle code is made shorter by the use of loops and definitions..
Feel free to copy the basic Python Turtle code that is given below. Don't hesitate to ask questions about the code if you have any. Enjoy! Please comment, like, or subscribe :)
Incidentally, for manually colorable graphics and variations, please visit my author url at https://www.amazon.com/author/basicpythonturtleart.url
import turtle
t = turtle.Turtle() #Definitions and Initializations
screen = turtle.Screen()
t.pensize(4)
sign_size = square_size = 350 #Changeable; Length of one side of square; square_size -- decreasing values
def square(color, square_size): #Procedure to draw a square with algorithm-assigned color and size
t.fillcolor(color) #Start of color-filling procedure for one square
t.begin_fill()
for i in range(4): #Loop to draw 4 sides of a square
t.forward(square_size)
t.left(90)
t.end_fill()
def intersection(): #Procedure to draw an x or intersection sign
t.fillcolor("black") #Start of color-filling procedure to make intersection sign "black"
t.begin_fill()
for i in range(4): #Loop to draw 4 edges of intersection sign
t.forward((0.5 /6) * square_size)
t.left(90)
t.forward((2 / 6) * square_size)
t.right(90)
t.forward((2 / 6) * square_size)
t.left(90)
t.forward((0.5 / 6) * square_size)
t.end_fill()
t.penup() #Python_Graphic start of drawing procedure
t.forward(sign_size / (2 ** 0.5))
for color in ["yellow", "black", "yellow"]: #Loop to draw 3 differently-sized and overlapping squares with indicated colors
t.left(135)
t.pendown()
t.pencolor(color)
square(color, square_size) #Function call to draw a square with algoritm-assigned color and size
square_size -= (1 / 25) * sign_size #Change in size for next square
t.penup()
t.home()
t.forward(square_size / (2 ** 0.5))
t.penup()
t.home()
t.forward((2.5 / 6) * square_size)
t.left(90)
t.pendown()
t.pencolor("black")
intersection() #Function call to draw an x or intersection sign
t.hideturtle()
screen.exitonclick()
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Simple Python Turtle Graphic and Code: Intersection Sign», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.