Necesito encontrar una manera para que mi programa le diga al usuario que gana o pierde dependiendo de si la tortuga está en el círculo o no

0

Este código hace que la tortuga haga una forma y luego le da al usuario diez movimientos para avanzar, retroceder, derecha e izquierda para mover la tortuga de regreso al círculo. Necesito encontrar una manera para que mi programa le diga al usuario que gana o pierde dependiendo de si la tortuga está en el círculo o no.Estoy tratando de usar los comandos xpos e ypos para saber dónde está la tortuga, pero estoy No estoy seguro de cómo usarlos para que pueda decir cuándo la tortuga está en el círculo o no.

#Importing the package
import turtle
shape = str()
direction = str()
#Change turtle color and background color
turtle.color("green")
turtle.Screen().bgcolor("blue")
screen = turtle.Screen()
#Ask the user what shape they want the turtle to be
shape = turtle.textinput("Enter a shape", "Enter a shape: classic, arrow, turtle, circle, square, or triangle.")
turtle.shape(shape)
#Making a circle
turtle.penup()
turtle.goto(-200, -100)
turtle.pendown()
turtle.fillcolor("red")
turtle.begin_fill()
turtle.circle(100)
turtle.end_fill()
turtle.penup()
turtle.color("green")
#Move turtle back to start
turtle.goto(0, 0)
#Moving the turtle into the circle
for counter in range(1, 11, 1):
    #getting the direction from the user
    direction = screen.textinput("Direction", "Enter F for Forward, B for Backward, R for Right and L for Left")
    if direction == "F":
        turtle.forward(100)
    elif direction == "B":
        turtle.backward(100)
    elif direction == "R":
        turtle.right(90)
        turtle.forward(100)
    else:
        turtle.left(90)
        turtle.forward(100)
    #end if
#Find where the turtles ending position is
xpos = turtle.xcor()
ypos = turtle.ycor()
turtle.write("Sorry You Lost", align="center", font=('Arial', '16', 'bold'))
turtle.write("Good Job You Won!", align="center", font=('Arial', '16', 'bold'))
turtle.exitonclick()
0
from turtle import Screen, Turtle

#Change turtle color and background color
tim = Turtle()
screen = Screen()
tim.color("green")
screen.bgcolor("blue")
#Ask the user what shape they want the turtle to be
shape = screen.textinput("Enter a shape", "Enter a shape: classic, arrow, turtle, circle, square, or triangle: ")
tim.shape(shape)
#Making a circle
tim.penup()
tim.goto(-200, -100)
tim.pendown()
tim.fillcolor("red")
tim.begin_fill()
tim.circle(100)
tim.end_fill()
tim.penup()
tim.color("green")
#Move turtle back to start
tim.goto(0, 0)
#Moving the turtle into the circle
for counter in range(1, 11, 1):
    #getting the direction from the user
    direction = screen.textinput("Direction", "Enter F for Forward, B for Backward, R for Right and L for Left")
    if direction == "F":
        tim.forward(100)
    elif direction == "B":
        tim.backward(100)
    elif direction == "R":
        tim.right(90)
        tim.forward(100)
    else:
        tim.left(90)
        tim.forward(100)
    #end if
#Find where the turtles ending position is
xpos = tim.xcor()
ypos = tim.ycor()
print(xpos)
print(ypos)
tim.write("Sorry You Lost", align="center")
tim.write("Good Job You Won!", align="center")

screen.exitonclick()

Aquí, arreglé tu código y creo que ahora está funcionando exactamente como querías.