Mein Code bleibt am Ende der Prepare_for_answer-Funktion hängen. Gibt es etwas wirklich Offensichtliches, das ich übersePython

Python-Programme
Anonymous
 Mein Code bleibt am Ende der Prepare_for_answer-Funktion hängen. Gibt es etwas wirklich Offensichtliches, das ich überse

Post by Anonymous »

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()

Wie ich oben sagte, bleibt der Code beim zweiten Durchlauf hängen. Ignorieren Sie die Grafiken, immer noch WiP, aber ich habe keine Ahnung, was hier falsch läuft. Irgendwelche Ideen?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post