Pi and deg2rad have to be defined if the script is imported too.

This commit is contained in:
The Wobbler 2023-12-29 20:43:49 +01:00
parent cc7685c458
commit 82bffd6caf

View file

@ -7,6 +7,11 @@ from math import sin, cos, tan, sqrt
from time import sleep from time import sleep
# pi is not defined by default
pi = 3.1416
deg2rad = pi / 180
######################################################################################## ########################################################################################
def berechneflugbahn(xmax, ymax, steps, startwinkel, startgeschwindigkeit, xmin=0, ymin=0, starthoehe=0, gravitation=9.81, xstep=1): def berechneflugbahn(xmax, ymax, steps, startwinkel, startgeschwindigkeit, xmin=0, ymin=0, starthoehe=0, gravitation=9.81, xstep=1):
x = 0 x = 0
@ -79,9 +84,7 @@ if __name__ == "__main__":
cows = "🐵🐒🦍🦧🐕🐯🦝🐩🐅🐴🐎🦄🦌🐗🐂🐃🐄🐪🐫🦙🦒🐹🦘🦡🐧🕊️ 🦅🦆🦉🐍🦎🐊🦜🦚🦩🐲🐉🦕" cows = "🐵🐒🦍🦧🐕🐯🦝🐩🐅🐴🐎🦄🦌🐗🐂🐃🐄🐪🐫🦙🦒🐹🦘🦡🐧🕊️ 🦅🦆🦉🐍🦎🐊🦜🦚🦩🐲🐉🦕"
cowlistlength = len(cows) cowlistlength = len(cows)
cow = cows[random.randint(0, cowlistlength - 1)] cow = cows[random.randint(0, cowlistlength - 1)]
# pi is not defined by default
pi = 3.1416
deg2rad = pi / 180
# Needed: find our screensize. We are in textmode here # Needed: find our screensize. We are in textmode here
termsize_xy = os.get_terminal_size() termsize_xy = os.get_terminal_size()