commit 74a7c9dc50670a1a9828e2c030353f68a4d43939 Author: humorhenker Date: Sun Jul 17 03:19:43 2022 +0200 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..3afa3eb --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# WolfPack Helpers + +collection of python scripts for calculations in the UBoat game Wolfpack diff --git a/aob_calc/aob_calc.py b/aob_calc/aob_calc.py new file mode 100644 index 0000000..40be65f --- /dev/null +++ b/aob_calc/aob_calc.py @@ -0,0 +1,26 @@ +import math + +print("Humorhenker AOB calc script") +print("---------------------------") + +print("Enter height (in m)") +height = float(input()) +print("Enter length (in m)") +length = float(input()) + +print("Enter vertical marks") +vertical = float(input()) +print("Enter horizontal marks") +horizontal = float(input()) + +try: + aob = math.degrees(math.asin(height/length*horizontal/vertical*1.745)) +except ValueError: + print("ValueError | AOB close to 90°") + +print("Ship already passed?") +passed = input() +if (passed in ["y", "Y", "yes", "Yes", "j", "J", "ja", "Ja"]): aob = 180-aob + +print("---------------------------") +print("AOB is %s°" % round(aob, 2)) \ No newline at end of file diff --git a/speed_calc/speed_calc.py b/speed_calc/speed_calc.py new file mode 100644 index 0000000..2aa6a4c --- /dev/null +++ b/speed_calc/speed_calc.py @@ -0,0 +1,10 @@ +print("Humorhenker speed calc script") +print("---------------------------") + +print("Enter length (in m)") +length = float(input()) +print("Enter time (in s)") +time = float(input()) + +print("---------------------------") +print("speed is %s kn" % round(length/time*1.944, 2)) \ No newline at end of file