Previous Lecture Complete and continue  

  Project 1: Circle of Squares

104 comments
Sameer
https://repl.it/FOhy
wenting zhang
https://repl.it/FOER/0
Gareth Warner
https://repl.it/FNS9/0
Bilal fiaz
https://repl.it/FM0s/1
Arjun Rao
import turtle
my_turtle=turtle.Turtle()
def square():
for i in range(4):
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.speed(10000)
my_turtle.color('orange')

for i in range (100):
square()
my_turtle.right(10)

my_turtle.left(193.456)


mohandes Grilj
import turtle

t = turtle.Turtle()


def squares(lenght, angel):

t.forward(lenght)
t.left(angel)
t.forward(lenght)
t.left(angel)
t.forward(lenght)
t.left(angel)
t.forward(lenght)
t.left(angel)
t.left(angel/9)

for i in range(10000):
squares(100,90)



print(squares())
Mast Ram Sharma
https://repl.it/FJ66/4
Karlo Turk
import turtle

my_turtle = turtle.Turtle()

def square(lenght, angle):


my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)


for LE in range(20000):
square(50, 90)
my_turtle.right(1)
turtle.speed(0)
I know it's not right, I basically did it so It turns for 1 degree, actually looks cool
aron bleier
import turtle

a = turtle.Turtle()

def square(n,m,l):
a.forward(n)
a.right(m)
a.forward(n)
a.right(m)
a.forward(n)
a.right(m)
a.forward(n)
a.right(l)
for i in range(36):
square(100,90,100)
Christopher Vargas
https://repl.it/FJhM/0
Aman Tyagi
https://repl.it/FJ66/0
Andrej Radojcic
YAY I DIDI IT!
Praneeth
import turtle
a = turtle.Turtle()
def square():
a.forward(50)
a.right(90)
a.forward(50)
a.right(90)
a.forward(50)
a.right(90)
a.forward(50)

for i in range(30):
square()
a.right(80)


Vineet Yadav
import turtle
t=turtle.Turtle()
def circleofsquares(distance,angle,turningangle):
for j in range(1000):
for i in range(4):
t.forward(distance)
t.left(angle)
t.left(turningangle)
circleofsquares(100,90,10)

repl.it gave me errors
ajay
import turtle


import turtle

turtle=turtle.Turtle()
def fun(length,angle):
turtle.forward(length)
turtle.right(angle)
turtle.forward(length)
turtle.right(angle)
turtle.forward(length)
turtle.right(angle)
turtle.forward(length)
turtle.right(101)

for i in range(10000):
fun(100,90)
Hithaishy B
#circle of squares
import turtle
my_turtle = turtle.Turtle()

def square():
my_turtle.forward(75)
my_turtle.left(90)
my_turtle.forward(75)
my_turtle.left(90)
my_turtle.forward(75)
my_turtle.left(90)
my_turtle.forward(75)
my_turtle.left(75)

for i in range(25):
square()
Anas Munir
import turtle
logan=turtle.Turtle()
def circle_of_sq(length,angle,new_angle):
logan.forward(length)
logan.right(angle)
logan.forward(length)
logan.right(angle)
logan.forward(length)
logan.right(angle)
logan.forward(length)
logan.right(new_angle)

for i in range(100):
circle_of_sq(100,90,100)
Jaypee Genobe
https://repl.it/FGkw/0
Richard Franck
https://repl.it/FGgx/0
abdul hussain
import turtle

good = turtle.Turtle()
good.speed(10)

def star(length, angle):
for i in range(4):
good.forward(length)
good.left(angle)

for y in range(360):
star(100,90)
good.left(1)
abdul hussain
import turtle

good = turtle.Turtle()
good.speed(5)

def star(length, angle):
for i in range(4):
good.forward(length)
good.left(angle)

for y in range(360):
star(100,90)
good.left(15)
Brayan Matos Ruiz
import turtle

my_turtle = turtle.Turtle()

def square():
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.left(25)

for squares in range(100):
square()
Deviprasad Ojha
import turtle
d_trtl = turtle.Turtle()
d_trtl.speed(0)

def sqr(x,y):
for i in range(4):
d_trtl.forward(x)
d_trtl.right(y)

for i in range(100):
d_trtl.color('yellow')
sqr(200,90)
d_trtl.right(11)

for i in range(100):
d_trtl.color('red')
sqr(200,90)
d_trtl.right(11)

for i in range(100):
d_trtl.color('blue')
sqr(200,90)
d_trtl.right(11)

Seth Satterwhite
import turtle
frank = turtle.Turtle()

def square(length, angle):
frank.forward(length)
frank.right(angle)
frank.forward(length)
frank.right(angle)
frank.forward(length)
frank.right(angle)
frank.forward(length)
for i in range(10000):
square(100, 90)
frank.right(80)
Richard Harding
import turtle
my_turtle = turtle.Turtle()
def square(length, angle):
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
for i in range(500):
square(50,90)
square(0,1)
Nathan Swedlund
import turtle
turt = turtle.Turtle()
def HEX_FUNC(length, angle, angle2):
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.forward(length)
turt.left(angle)
turt.left(angle2)
turt.speed(500)
for i in range(1000):
HEX_FUNC(30, 45, 10)
Jonas Abarham
https://repl.it/FDYI/0
Ashutosh Shukla
import turtle

a=turtle.Turtle()
def square(length,angle):
a.forward(length)
a.right(angle)
a.forward(length)
a.right(angle)
a.forward(length)
a.right(angle)
a.forward(length)

for i in range(100):
square(100,90)
a.right(1)
Ali
3 circles of squares
https://repl.it/EyXR/1
kenneth R. Aponte Mendez
it was so simple but so cool to watch!!!
here is mine:

import turtle

my_turtle = turtle.Turtle()

def square(length, angle):
for i in range(4):
my_turtle.forward(length)
my_turtle.right(angle)



for i in range(1000):
square(40, 90)
my_turtle.right(20)
square(40, 90)
Mate Aditya Anil
import turtle
my_turtle = turtle.Turtle()
my_turtle.speed(0)
def square(Length,angle):
my_turtle.forward(Length)
my_turtle.right(angle)
my_turtle.forward(Length)
my_turtle.right(angle)
my_turtle.forward(Length)
my_turtle.right(angle)
my_turtle.forward(Length)
my_turtle.right(11)
for i in range(1000000000):
square(100,90)

Abdulla Omaruddin
import turtle

my_turtle = turtle.Turtle ()

def square (length, angle):
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)
square (100, 90)

def spinning (length, angle):
my_turtle.left (60)
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)
my_turtle.left (angle)
my_turtle.forward (length)

for s in range (30):
spinning (100, 90)
Gianlucca

https://repl.it/FDCz/0
Marco
https://repl.it/FDCS/0
Deviprasad Ojha
import turtle

d_trtl=turtle.Turtle()

def sqr(m,n):
d_trtl.forward(m)
d_trtl.right(n)
d_trtl.forward(m)
d_trtl.right(n)
d_trtl.forward(m)
d_trtl.right(n)
d_trtl.forward(m)


for i in range(1000):
sqr(200,90)
d_trtl.right(85)
Zsolt Bisztray
https://repl.it/FCen/0
Adex Elizy
I did it))))

import turtle

ggo = turtle.Turtle()

def square(length, angle):
ggo.forward(length)
ggo.left(angle)
ggo.forward(length)
ggo.left(angle)
ggo.forward(length)
ggo.left(angle)
ggo.forward(length)
ggo.left(100)

for i in range(60):
square(50, 90)
Mitchell Gallant
https://repl.it/FBwX/0
Erika
Mine came out looking like a circle inside a circle made out of squares. I'll see in the next video what I needed to do to keep the edges from becoming a circle.

import turtle

bob = turtle.Turtle()
def box():

bob.forward(200)
bob.right(90)
bob.forward(200)
bob.right(90)
bob.forward(200)
bob.right(90)
bob.forward(200)
def spinning():
box()
bob.right(95)
box()
bob.right(95)
box()
bob.right(95)

for i in range (25):
spinning()
Manny Garcia
https://repl.it/EyKG/0
Tony Gonzalez
https://repl.it/languages/python_turtle

^ you had to go here to use the turtle format.
Tony Gonzalez
https://repl.it/FAvi/0
Mohammed Alfathali
https://trinket.io/python/bdbb1140a0
Miroslav
https://repl.it/FAa9/0
Phuc Le
https://repl.it/FA1m/0
Sachin Dindor
https://repl.it/FA17/0
Jordan
https://repl.it/FADG/0

I think I am excelling in your class, this took me five minutes and i even sped it up. Thanks and keep up the good work XD
ashish dagar
import turtle
a=turtle.Turtle()

def doc(length,angle):
a.forward(length)
a.right(angle)
a.forward(length)
a.right(angle)
a.forward(length)
a.right(angle)
a.forward(length)
for i in range (50):
doc(90,90)
a.right(102)

i did it
Roberto Torres
https://trinket.io/python/0c63c1f3c6
Ereatara Kokiri
this is my square lol
for ere in range(10):
square(50,90)
my_turtle.right(10)
Askild
import turtle

t = turtle.Turtle()
t.speed(100)
for i in range(36):
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.right(10)

turtle.done()

to make the perfect circle, if u are struggeling
Thomas Liebig
import turtle

my_turtle = turtle.Turtle()

def square():

my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(90)
my_turtle.forward(100)
my_turtle.left(80)



for i in range(40):
square()
karthik sundar
try this one
every time you run it you will get a new colored design

import turtle
import random
abc = turtle.Turtle()
defg = random.randint(0,225)
hij = random.randint(0,150)
klm = random.randint(0,225)

def drawsquare():
abc.pencolor(defg,hij,klm)
abc.fillcolor([hij,klm,defg],[klm,defg,hij])

abc.forward(100)
abc.right(90)
abc.forward(100)
abc.right(90)
abc.forward(100)
abc.right(90)
abc.forward(100)



for i in range(225):

drawsquare()


abc.right(100)

Wong Xien Hean
https://repl.it/EyjJ/0

Took Me 10 Min. Lol
Justas Norinkevicius
import turtle

asdf = turtle.Turtle()

def square(lenght,angle):
for i in range(4):
asdf.forward(lenght)
asdf.right(angle)

for s in range(6969):
square(100,90)
asdf.right(11)
Jordan Hansen
https://repl.it/EyUJ/0
gabbie feller
https://repl.it/EyD3/1
Sumit
import turtle

sumit=turtle.Turtle()
def square(angle):

sumit.forward(100)
sumit.left(90)
sumit.forward(100)
sumit.left(90)
sumit.forward(100)
sumit.left(90)
sumit.forward(100)
sumit.left(90)
sumit.right(angle)
for i in range(100):
square(25)
frederik larsen
import turtle
l = turtle.Turtle()

def X(F, A):
for i in range(4):
l.forward(F)
l.left(A)

#======================

for I in range(100):
X(50, 90)
l.right(10)
Hampus
import turtle

my_turtle = turtle.Turtle()

def circle(lenght, angle):
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)


for i in range(100):
circle(200, 90)
my_turtle.right(10)
Luis Alvarez Feliciano
import turtle

my_turtle = turtle.Turtle()

def square (length, angle, angle2):
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle2)

for i in range(100):
square(100, 90, 95)
#wujuuuuu xD
nagi reddy
check mine wat do u say?

https://trinket.io/python/97573170c7
Nasser
import turtle

bob = turtle.Turtle()

def square(Length, angle):

bob.forward(Length)
bob.left(angle)
bob.forward(Length)
bob.left(angle)
bob.forward(Length)
bob.left(angle)
bob.forward(Length)
bob.left(21)
bob.forward(50)

for i in range(500):
square(50, 45)

RUCHI VADSOLA
import turtle

my_turtle=turtle.Turtle()

def square():
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)

square()

for i in range(1000):
my_turtle.right(100)
square()
Bilal Haroon
https://trinket.io/python/bc8a407b86
Hatim Elsadig Elamin Elhag
https://repl.it/EwkQ/0
Louie Jay D. NIngasca
#whooo, this is fun,
#is there a limit in turtle speed? I cant make it even faster that this

import turtle

louie = turtle.Turtle()


def square(Length, Angle1, Angle2):

louie.forward(Length)
louie.left(Angle1)
louie.forward(Length)
louie.left(Angle1)
louie.forward(Length)
louie.left(Angle1)
louie.forward(Length)
louie.left(Angle2)

def circle():
for i in range (25):
louie.speed(100000000000)
louie.pencolor ("blue")
square(100,90,95)
for i in range (25):
louie.speed(100000000000)
louie.pencolor ("red")
square(75,90,95)
for i in range (25):
louie.speed(100000000000)
louie.pencolor ("yellow")
square(50,90,95)

for n in range(50):
circle()
sonam chophel
🐢.speed(0)
sonam chophel
import turtle
t=turtle.Turtle()
def square():
t.speed(10)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.forward(100)
t.left(100)
for i in range(36):
square()
Nahian Eshan
https://repl.it/EwaV/0
Dina Abdallah
for i in range(50):
square(60,89)
It's really pretty
Victoria Reynoso
import turtle
my_turtle = turtle.Turtle()
def square (length,angle):
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)

square (100,90)
my_turtle.right(100)

for i in range(200):
square (100,90)
my_turtle.right(100)
Rodrigo Pedetti
https://trinket.io/python/c51cc88c75
Xerxes
#circle project

import turtle
t = turtle.Turtle ()

def square(angle):
t.speed(100)
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
t.right(90)
t.forward(100)
t.right(angle)

for i in range(100):
square(100)


Robert Spina
import turtle

circle = turtle.Turtle()

def square(length, angle):
circle.forward(length)
circle.right(angle)
circle.forward(length)
circle.right(angle)
circle.forward(length)
circle.right(angle)
circle.forward(length)

for i in range(50):
square(60, 90)
circle.right(100)
zihad

https://trinket.io/python/1e0cc45351
St
import turtle

my_turtle = turtle.Turtle()

a = 95

def square(lenght, nic, a):
my_turtle.forward(lenght)

my_turtle.right(nic)

my_turtle.forward(lenght)

my_turtle.right(nic)

my_turtle.forward(lenght)

my_turtle.right(nic)

my_turtle.forward(lenght)

my_turtle.left(a)


for i in range(10):
square(100, 90, 95)
square(100, 90, 95)
square(100, 90, 95)
square(100, 90, 95)
TACO
https://repl.it/Es7j/0
Cooper Mann
https://www.repl.it/EsoP/0
Shweta Ikhe
import turtle

abc = turtle.Turtle()

def square(length, angle):
abc.forward(length)
abc.right(angle)
abc.forward(length)
abc.right(angle)
abc.forward(length)
abc.right(angle)
abc.forward(length)

for i in range(100):
square(50, 90)
abc.right(100)
Martin Lustig
My solution:
https://repl.it/Es7j/0

You make it really easy to understand - thank you!!
Alexander Helms
import turtle

x = turtle.Turtle()

d = x.right
a = x.left
w = x.forward


def square(angle,agle,leng):
w(leng)
a(agle)
w(leng)
a(agle)
w(leng)
a(agle)
w(leng)
a(angle)

for i in range(45):
square(82,90,100)
i
conrad kay
import turtle
my_turtle = turtle.Turtle()


n=50
a=95
for i in range(20):
my_turtle.forward(n)
my_turtle.left(a)
Adam Bessisso
https://trinket.io/python/54633e1f1b
Nick Fuller
Here's what I did for the project. I did the angle 14 so the squares wouldn't repeat since 360(full revolution) isn't divisible cleanly by 14.

import turtle

my_turtle = turtle.Turtle()

def square(length, angle):
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)

# square(20, 90)

for circleofsquares in range(400):
square(100, 90)
my_turtle.right(14)

circleofsquares()
Moni AlFlahi
https://trinket.io/python/95c3c7bc61

hope its good enugh
Anidhito Irmandharu
import turtle

Avant = turtle.Turtle()

def square(length ,turn):
Avant.forward(length)
Avant.right(turn)
Avant.forward(length)
Avant.right(turn)
Avant.forward(length)
Avant.right(turn)
Avant.forward(length)
Avant.right(turn)

# This 1/4 Of The Flower
# for flowersquare in range(7):
# square(100 ,90)
# Avant.right(15)

# After that , each only require 6 loop
# so there for it require ( 7 + 6 + 6 + 6 = 25 )

for flowersquare in range(25):
square(100 ,90)
Avant.right(15)


i wonder why it is 25 , instead of 24 to create a flower
prudhvi kandregula
import turtle
my_dog=turtle.Turtle()

def circlefromsqares(length,angle):
my_dog.right(100)
my_dog.forward(length)
my_dog.right(angle)
my_dog.forward(length)
my_dog.right(angle)
my_dog.forward(length)
my_dog.right(angle)
my_dog.forward(length)
circlefromsqares(100,90)
for i in range(100):
circlefromsqares(100,90)
Abboud Mahmi
import turtle

carl = turtle.Turtle()

def circle():
for i in range(4):
carl.forward(100)
carl.right(90)
carl.right(0+5)

for x in range(72):
circle()
Harshil Pasnani
Amazing we can change angle after completing 1 rotation on cicle by squares.
https://repl.it/Em7Z/0
pls check and reply
Austyn
https://repl.it/Em30/1
Kit Sum Pang
https://repl.it/ElkK/1
Ze At
import turtle
my_turtle = turtle.Turtle()

def square(lenght,angle):
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)
my_turtle.right(angle)
my_turtle.forward(lenght)

for i in range(1000):
square(100,90)
my_turtle.left(89)
Gary Lynch
Resubmitting, saw one of your users using speed() so I tried it and made the turning angle less

import turtle

my_turtle = turtle.Turtle()

def square(length, angle):
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)


for i in range(1000):
my_turtle.speed(100)
square (100,90)
my_turtle.right(3)
Gary Lynch
import turtle

my_turtle = turtle.Turtle()

def square(length, angle):
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)
my_turtle.forward(length)
my_turtle.right(angle)


for i in range(100):
square (100,90)
my_turtle.right(10)

João
What do you think of this circle of squares:

import turtle

t = turtle.Turtle()
t.speed(0)

def square(x,y):
t.forward(x)
t.right(y)
t.forward(x)
t.right(y)
t.forward(x)
t.right(y)
t.forward(x)

for inclination in range(100000):
square(100,90)
square(0,90+1)
Rafeh Qazi
João would you mind putting this into trinket.io and sharing a link with me!?
Elian Barajas
https://trinket.io/python/dfbcfa1f81

Here you go
Charles Lungu
man you are great hey...good work.
Elian Barajas
import turtle


circle = turtle.Turtle()


def cos(length, angle, f_angle):
circle.forward(length)
circle.right(angle)
circle.forward(length)
circle.right(angle)
circle.forward(length)
circle.right(angle)
circle.forward(length)
circle.right(f_angle)

for cir in range(100):
cos(50, 90, 5)
Charles Lungu
import turtle


c=turtle.Turtle()
c.speed(0)

def square(Y,X):
c.forward(Y)
c.left(X)
c.forward(Y)
c.left(X)
c.forward(Y)
c.left(X)
c.forward(Y)

for i in range(100):
square(100,90)
square(0,30+2)
Daniel Miller
import turtle
w=turtle.Turtle()
def square(length,angle):
w.forward(length)
w.right(angle)
w.forward(length)
w.right(angle)
w.forward(length)
w.right(angle)
w.forward(length)
w.right(angle)
w.right(10)

for i in range(30):
square(50,90)
gokulakrishnan
import turtle

my_turtle=turtle.Turtle()


def square(length,angle):
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)




for i in range(100):
square(50,90)
my_turtle.left(1)




working good....
cool!
birajkarki
my_turtle = turtle.Turtle()


def square(length, angle):
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)

my_turtle.left(80)

my_turtle.forward(length)
my_turtle.left(80)
my_turtle.forward(length)
my_turtle.left(80)
my_turtle.forward(length)
my_turtle.left(80)
my_turtle.forward(length)









for i in range(100):
square(50, 90)


i think i am close