To answer your question, the code continues, I don’t know what nothing is in terms of float values.
Im referring to blanks as in nothing, just pressing enter when you get the input. What I am actually working on is below, the bug is the input after it prints “1 for pentagon, 2 for square, 3 for triangle, and 4 to clear.”:
import turtle
def grid():
global area, red, green, blue, area_2, shape
turtle.shape("circle")
print('Creating grid...')
turtle.speed(5000)
turtle.color('#000000')
turtle.goto(-1000,0)
turtle.goto(1000,0)
turtle.goto(0,0)
turtle.goto(0,1000)
turtle.goto(0,-1000)
turtle.goto(0,0)
turtle.color('#999999')
for count in range(10):
turtle.forward(20)
move()
turtle.goto(0,0)
for count2 in range(10):
turtle.backward(20)
move()
turtle.goto(0,0)
turtle.right(90)
for count3 in range(10):
turtle.backward(20)
move()
turtle.goto(0,0)
for count4 in range(10):
turtle.forward(20)
move()
turtle.color('#000000')
turtle.penup()
turtle.goto(0,0)
turtle.pendown()
turtle.left(90)
turtle.goto(-1000,0)
turtle.goto(1000,0)
turtle.goto(0,0)
turtle.goto(0,1000)
turtle.goto(0,-1000)
turtle.goto(0,0)
print('Done!')
print('')
turtle.color('#000000')
ask()
def move():
global area, red, green, blue, area_2, shape
turtle.right(90)
turtle.forward(200)
turtle.backward(400)
turtle.forward(200)
turtle.left(90)
def text_prompt(msg):
try:
return raw_input(msg)
except NameError:
return input(msg)
def ask():
global area, red, green, blue, area_2, shape
turtle.penup()
area = float(text_prompt('Enter a value from -10 - 10 for [X] value'))
while area > 10:
print('Number is not inbetween -10 and 10')
print('')
area = float(text_prompt('Enter a value from -10 - 10 for [X] value'))
while area < -10:
print('Number is not inbetween -10 and 10')
print('')
area = float(text_prompt('Enter a value from -10 - 10 for [X] value'))
turtle.speed(1.1)
turtle.goto(area * 20,0)
area_2 = float(text_prompt('Enter a value from -10 - 10 for [Y] value'))
while area_2 > 10:
print('Number is not inbetween -10 and 10')
print('')
area_2 = float(text_prompt('Enter a value from -10 - 10 for [X] value'))
while area_2 < -10:
print('Number is not inbetween -10 and 10')
print('')
area_2 = float(text_prompt('Enter a value from -10 - 10 for [X] value'))
turtle.goto(area * 20,area_2 * 20)
turtle.pendown()
red = float(text_prompt('Enter a value from 0 - 255 for [RED] value'))
blue = float(text_prompt('Enter a value from 0 - 255 for [BLUE] value'))
green = float(text_prompt('Enter a value from 0 - 255 for [GREEN] value'))
print('')
print('1 for pentagon, 2 for square, 3 for triangle, and 4 to clear.')
shape = float(text_prompt(''))
while shape > 5:
print('Number is not inbetween 1 and 5')
print('')
shape = float(text_prompt(''))
while shape < 1:
print('Number is not inbetween 1 and 5')
print('')
shape = float(text_prompt(''))
if shape == 1:
pentagon()
elif shape == 2:
square()
elif shape == 3:
triangle()
elif shape == 4:
clear()
elif shape == 5:
clear2()
def colour_rgb(r, g, b):
r = round(min(100, max(0, r)) * 2.55)
g = round(min(100, max(0, g)) * 2.55)
b = round(min(100, max(0, b)) * 2.55)
return '#%02x%02x%02x' % (r, g, b)
def pentagon():
global area, red, green, blue, area_2, shape
turtle.color(colour_rgb(red, green, blue))
turtle.shape("circle")
turtle.speed(10)
turtle.begin_fill()
turtle.right(72)
for count5 in range(5):
turtle.forward(-40)
turtle.right(72)
turtle.end_fill()
turtle.left(72)
ask()
def square():
global area, red, green, blue, area_2, shape
turtle.color(colour_rgb(red, green, blue))
turtle.shape("circle")
turtle.speed(10)
turtle.begin_fill()
turtle.right(90)
for count6 in range(4):
turtle.forward(-60)
turtle.right(90)
turtle.end_fill()
turtle.left(90)
ask()
def triangle():
global area, red, green, blue, area_2, shape
turtle.color(colour_rgb(red, green, blue))
turtle.shape("circle")
turtle.speed(10)
turtle.right(120)
turtle.begin_fill()
for count7 in range(3):
turtle.forward(-60)
turtle.right(120)
turtle.end_fill()
turtle.left(120)
ask()
def clear():
global area, red, green, blue, area_2, shape
turtle.speed(5000)
turtle.color('#ffffff')
turtle.penup()
turtle.goto(-1000,-1000)
turtle.pendown()
turtle.begin_fill()
turtle.goto(-1000,1000)
turtle.goto(1000,1000)
turtle.goto(1000,-1000)
turtle.end_fill()
turtle.penup()
turtle.speed(5)
turtle.goto(0,0)
turtle.pendown()
turtle.color('#000000')
grid()
ask()
def clear2():
global area, red, green, blue, area_2, shape
turtle.speed(5000)
turtle.color('#ffffff')
turtle.penup()
turtle.goto(-1000,-1000)
turtle.pendown()
turtle.begin_fill()
turtle.goto(-1000,1000)
turtle.goto(1000,1000)
turtle.goto(1000,-1000)
turtle.end_fill()
turtle.penup()
turtle.speed(5)
turtle.goto(0,0)
turtle.pendown()
turtle.color('#000000')
ask()
grid()