From 0505f3f1c96c6f1df8b64b08c7e70001aa9b8910 Mon Sep 17 00:00:00 2001 From: Maximilian Wagner Date: Mon, 5 Jun 2023 11:37:37 +0200 Subject: [PATCH] Extension des Simulators pog --- hpCalcSim.py | 39 ++++++++++++++++++++++++++-------- res.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 res.txt diff --git a/hpCalcSim.py b/hpCalcSim.py index 433bed1..bcba57c 100644 --- a/hpCalcSim.py +++ b/hpCalcSim.py @@ -11,6 +11,8 @@ APog = [2,3,4,5] HPmult = 2 APmult = 2 +simRes = "" + print("AP:HP:HPnew\n") for i in range(0,4): @@ -18,24 +20,33 @@ for i in range(0,4): AP = HPog match i: case 0: - print("## Calculating without Multipliers ##") + caseString = "## Calculating without Multipliers ##" + print(caseString) + simRes += caseString case 1: - print("\n## Calculating with Attack Multipliers ##") + caseString = "\n## Calculating with Attack Multipliers ##" + print(caseString) + simRes += caseString AP = [point * 2 for point in AP] case 2: - print("\n## Calculating with Defense Multipliers ##") + caseString = "\n## Calculating with Defense Multipliers ##" + print(caseString) + simRes += caseString HP = [point * 2 for point in HP] case 3: - print("\n## Calculating with Attack and Defense Multipliers ##") + caseString = "\n## Calculating with Attack and Defense Multipliers ##" + print(caseString) + simRes += caseString AP = [point * 2 for point in AP] HP = [point * 2 for point in HP] - - print("-First Iteration-") + itString = "\n-First Iteration-\n" + print(itString) + simRes += itString liste = [AP, HP] combinations = [p for p in it.product(*liste)] @@ -44,11 +55,21 @@ for i in range(0,4): for comb in combinations: for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"): - print(str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"])) + tmpStr = str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"]) + "\n" + print(tmpStr) + simRes += tmpStr newcombs.append((comb[0], soln["HPnew"])) - print("-Second Iteration-") + itString = "\n-Second Iteration-\n" + print(itString) + simRes += itString for comb in newcombs: for soln in pl.query("einheit_alive("+str(comb[0])+","+str(comb[1])+", HPnew)"): - print(str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"])) + tmpStr = str(comb[0]) + ":" + str(comb[1]) + ":" + str(soln["HPnew"]) + "\n" + print(tmpStr) + simRes += tmpStr + + +with open("res.txt", "w") as w: + w.write(simRes) \ No newline at end of file diff --git a/res.txt b/res.txt new file mode 100644 index 0000000..a0b72d3 --- /dev/null +++ b/res.txt @@ -0,0 +1,59 @@ +## Calculating without Multipliers ## +-First Iteration- +1:2:1 +1:3:2 +1:5:4 +2:3:1 +2:5:3 +3:5:2 + +-Second Iteration- +1:2:1 +1:4:3 +2:3:1 + +## Calculating with Attack Multipliers ## +-First Iteration- +2:3:1 +2:5:3 +4:5:1 + +-Second Iteration- +2:3:1 + +## Calculating with Defense Multipliers ## +-First Iteration- +1:2:1 +1:4:3 +1:6:5 +1:10:9 +2:4:2 +2:6:4 +2:10:8 +3:4:1 +3:6:3 +3:10:7 +5:6:1 +5:10:5 + +-Second Iteration- +1:3:2 +1:5:4 +1:9:8 +2:4:2 +2:8:6 +3:7:4 + +## Calculating with Attack and Defense Multipliers ## +-First Iteration- +2:4:2 +2:6:4 +2:10:8 +4:6:2 +4:10:6 +6:10:4 + +-Second Iteration- +2:4:2 +2:8:6 +4:6:2