repl.it
@AHulot/

Shape Maker

Python (with Turtle)

My Assessment for Robotics Class

fork
loading
main.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Press RUN to start the program. Please note that every time you answer a question you must click RESULT and then go back to the CONSOLE for the next question. 

# If there is an erorr in your entry, you will have to re run the program.
#WORK IN PROGRESS

import turtle

def DrawCircle():
  sides = 0
  while sides < 38:
    turtle.forward(size)
    turtle.left(10)
    sides = sides + 1

def DrawSquare():
  sides = 0
  while sides < 4:
    turtle.forward(size)
    turtle.right(90)
    sides = sides + 1

def DrawTriangle():
  turtle.right(60)
  turtle.forward(size)
  sides = 0
  while sides < 2:
    turtle.right(120)
    turtle.forward(size)
    sides = sides + 1

def DrawHexagon():
  sides = 0
  while sides < 8:
    turtle.right(45)
    turtle.forward(size)
    sides = sides + 1



print("WORK IN PROGRESS")
print("")
print("Hello User. Welcome to Shape Maker:")
print("")
print("Answer the following questions to make a shape.")
print("")
print("AFTER YOU PRESS ENTER, CLICK RESULT AND THEN GO BACK TO THE CONSOLE TO ANSWER THE NEXT QUESTION.")
print("")
print("Do not use capital letters and answer questions correctly. Coloring and Drawing may take a while. Please be patient.")
print("")

size = int(input("What size do you want your shapes to be? Type a number: "))

Color = input("What color do you want your shape to be? (Type: blue/red/yellow/green/black/pink) The default color is Black. ")
print("")

if Color == "blue":
  turtle.color("blue")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("Please check your entries for erorrs,")
    print("You will have to start again! Press RUN.")
elif Color == "red":
  turtle.color("red")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("You will have to start again! Press Run")
elif Color == "green":
  turtle.color("green")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("You will have to start again! Press Run")
elif Color == "yellow":
  turtle.color("yellow")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("You will have to start again! Press Run")
elif Color == "pink":
  turtle.color("pink")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("You will have to start again! Press Run")
else: 
  turtle.color("black")
  Shape = input("What shape do you want to draw? (Type: square/triangle/hexagon/circle) ")
  if Shape == "square":
    DrawSquare()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "triangle":
    DrawTriangle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "hexagon":
    DrawHexagon()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  elif Shape == "circle":
    DrawCircle()
    print("Your shape is being drawn...")
    print("Click result to view it.")
  else:
    print("I am sorry but I don't know how to draw that!")
    print("You will have to start again! Press Run")
result
console