-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturtleBasics.py
69 lines (58 loc) · 1.14 KB
/
turtleBasics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import turtle
from math import sqrt
from random import randrange
#Define the turtle
bob = turtle.Turtle()
#Turtle Speed
bob.speed(1)
#Turtle Color
bob.color("blue")#we can use #000000 (RGB codes)
#Moving
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
#make square
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
#Fill inside the square
# bob.color("blue", "green")#for inside color
# bob.begin_fill()
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
# bob.left(90)
# bob.forward(100)
# bob.end_fill()
#Make a space
# bob.penup()
# bob.forward(100)
# bob.pendown()
# bob.forward(100)
#Make a flower
# bob.color("purple","yellow")
# bob.speed(10)
# bob.begin_fill()
# for i in range(100):
# bob.forward(sqrt(i)*20)
# bob.left(170)
# bob.end_fill()
#Random Drawin something
# bob.color("purple")
# bob.speed(10)
# for i in range(100):
# i = randrange(0,10)
# bob.forward(sqrt(i)*20)
# bob.left(170)
#something weird
# for i in range(100):
# bob.forward(sqrt(i)*10)
# bob.left(45)
#For stop the turtle
turtle.done()