added attackplan creator script and screenshot

This commit is contained in:
Paul 2022-07-28 02:11:43 +02:00
parent 908dd60b5b
commit 0cf81562f4
3 changed files with 54 additions and 0 deletions

View File

@ -5,3 +5,5 @@ collection of python scripts for calculations in the UBoat game Wolfpack
![Screenshot aob](doc/img/aob_calc.png)
![Screenshot speed](doc/img/spd_calc.png)
![Screenshot attackplan](doc/img/attackplan.png)

52
attackplan/attackplan.py Normal file
View File

@ -0,0 +1,52 @@
print("Humorhenker Attackplan script")
print("---------------------------")
def stohms(sectime):
seconds = sectime % (24 * 3600)
hours = seconds // 3600
seconds %= 3600
minutes = seconds // 60
seconds %= 60
return "{hours:02d}:{minutes:02d}:{seconds:02d}".format(hours=hours,minutes=minutes, seconds=seconds)
def stoms(sectime):
minutes = sectime // 60
sectime %= 60
return "{minutes:02d}:{seconds:02d}".format(minutes=minutes, seconds=sectime)
seconds = seconds % (24 * 3600)
hour = seconds // 3600
seconds %= 3600
minutes = seconds // 60
seconds %= 60
print("Enter TOI (format Hours:Minutes):")
toi = input().split(":")
toi = int(toi[0])*60*60 + int(toi[1])*60
print("-------------")
eels = []
print("Enter an identifier and a TTI for each shot")
print("-------------")
while (True):
print("Name:")
name = input()
if (name == ""):
break
print("-------------")
print("TTI (format Minutes:Seconds):")
tti = input().split(":")
tti = int(tti[0])*60 + int(tti[1])
eels.append({"name": name, "tti": tti})
print("-----------------")
print("---------------------------")
eels.sort(key=lambda eel: eel["tti"], reverse=True)
print("Attackplan:")
print("{name:<15} {cut:<15} {cdt:<22} {rt:<15}".format(name="Name", cut="count up time", cdt="count down time", rt="realtime"))
print("")
for eel in eels:
print("{name:<15} {cut:<15} {cdt:<22} {rt:<15}".format(name=eel["name"], cut=stoms(eels[0]["tti"] - eel["tti"]), cdt=stoms(eel["tti"]), rt=stohms(toi-eel["tti"])))
print("")

BIN
doc/img/attackplan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB