Files
inf-kswo/ExamStuff/prfg Aufgabe 8 Cross.py
Janis Hutz ede0ee318b Format
There really is no hope of making this code even half-way decent without
spending the time to rewrite them all properly. Don't want to do any of
that
2025-11-03 17:08:35 +01:00

36 lines
672 B
Python
Executable File

from turtle import *
import math
rt(45)
go = 1
color("red")
distance_in = int(
numinput(
"Wie weit darf sich die Turtle vom Mittelpunkt entfernen??",
" Gerade Zahl von 1-unendlich ",
300,
minval=1,
)
)
for i in range(4):
go = 1
while go == 1:
fd(50)
dot(25)
x = xcor()
y = ycor()
distance = math.sqrt((x**2) + (y**2))
if distance >= distance_in:
go = 0
else:
if distance <= -distance_in:
go = 0
else:
go = 1
bk(distance_in)
rt(90)