52 lines
1.5 KiB
Python
52 lines
1.5 KiB
Python
|
|
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("") |