LOGO Commands
#Simple commands
p.fd(50) #forward 50
p.bk(40) #back 40
p.rt(90) #right 90 degrees
p.lt(45) #left 45 degrees
p.circle(60) #Draw circle radius of 60
p.circle(60,180) #Draw a circle of radius 60 that only goes 180 degrees round
p.circle(60,360,8) #Draw a shape radius 60° for a full 360° with 8 straight sides (Octagon)
#Colour Note American spelling
p.color(“red”,”green”) #first is line colour (red) #second is fill colour if shape is closed (green)
p.begin_fill() #Shapes between begin_fill and end_fill will be filled
p.end_fill() #Shapes between begin_fill and end_fill will be filled
p.pd() #Pendown on screen (Move and draw)
p.pu() #Pen up from screen (move without drawing)
p.pencolor(“brown”) #set pen to brown
p.pensize(3) #Normal size is 1
p.reset() #Clear the screen, send turtle back to its starting place
p.speed(0) #Fastest 0 Slowest 1 middle 6
p.stamp(“blue”) #Stamps a copy of the turtle in blue where you tell it to
#Repeat code
for i in range(10): #Repeats all code underneath 10 times
p.fd(20) #To be part of the repeat loop[ code must be indented
p.rt(30)
#Variable inside repeat code
length=20 #create a variable and put 20 inside it
for i in range(10):
p.fd(length) #Move forward whatever number is inside variable length
p.rt(30)
length=length+5
#Increase variable length by 5 each time the code loops
#On the second loop the line would be 25 on the third loop 30 etc
#You can use multiple variables inside one loop
#You can use a variable to replace any number
Make sure you create code below p=RawTurtle(s1) and above TK.mainloop()