Geometric Spirals in Python

preview_player
Показать описание
This program creates a geometric spiral of both a square or triangle. If you would like to alter the shape, you can divide 360 by the number of sides of the shape you want, and that gives you the angle to turn.
Рекомендации по теме
Комментарии
Автор

I replaced the angle with the random function and it creates abstract works of art

combardus
Автор

why did you multiply ? am confused. the forward is supposed to go forward. what happens when we multiply??

aliahsan
Автор

I have to design a program that uses two nested for loops to draw a spiral curve with the turtle.
You must use two nested for loops for this assignment. Can't use a while loop.
This curve is not a curve at all. Look closely. It's an optical illusion. It is actually 37 separate squares, each 5 pixels bigger than the previous and offset by 10 degrees.
Can you help?

vijaykavuri
Автор

I added a little extra. You'll get asked what angle you want to have

thedragonborn
Автор

import turtle
my_boy=turtle.Turtle()

my_boy.speed(0)
for i in range (500):
my_boy.forward(i)
my_boy.right(90)

arnavraj
Автор

i like to watch how it slowly builds up

thedragonborn
Автор

Your code didn't work, the IDE kept popping errors. So, here's my code:
import turtle

window = turtle.Screen()
window.title("SPIRAL by Taner")

window.setup(width=500, height=500, startx=10, starty=10)

t1 = turtle.Turtle()
t1.hideturtle()
t1.speed(9)

for i in range(500):
t1.forward(i)
t1.right(90)

tanercoder