Code: Select all
from turtle import *
import random
import time
#making the main 8-ball
def main_8_ball():
#used to be the main drawing, not needed
write("8", font=('Arial',24,'normal'))
turtle_prepare_for_answer()
def main_logic(): #Taken from the magic 8 ball assignment in Q2
useless_input=textinput("Turtle Vision","Ask a question to explore the depths of the future. Press 'esc' to quit: ")
output_int=random.randint(0,19)
#print(output_int) #for test reasons
if useless_input=="stop":
quit()
#useless decision-making stuff
def turtle_prepare_for_answer():
right(180)
fd(200)
write(main_logic())
time.sleep(10)
reset() #gets stuck here, doesn't run the question again
main_8_ball()
loop_setter=1
while loop_setter==1:
main_8_ball()
#user can see output until program is killed manually. also nice for testing the turtle
done()
Mobile version