Skip to content

Commit 9b98864

Browse files
committed
Update win percentage display and adjust plot limits; rename menu option for clarity
1 parent 3711e9a commit 9b98864

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def winPercentage():
170170
wins = sum(1 for result in results if result["escaped"])
171171

172172
winPercentage = (wins / total_sims) * 100
173-
winStr = f"{winPercentage:.10f}".rstrip('0').rstrip('.')
173+
winStr = f"{winPercentage:.10f}".rstrip('0').rstrip('.') + "%"
174174
return winStr
175175

176176
def printAvgBoxChecks():
@@ -187,6 +187,7 @@ def printAvgBoxChecks():
187187

188188
plt.bar(avgChecksPerPrisoner.keys(), avgChecksPerPrisoner.values())
189189
plt.axhline(y=overallAvg, color='r', linestyle='-', label=f'Overall Average: {overallAvg:.2f}')
190+
plt.ylim(0, config["CONFIG"]["total_box_checks"])
190191
plt.xlabel("Prisoner ID")
191192
plt.ylabel("Average Checked Boxes")
192193
plt.title("Average Checked Boxes per Prisoner")
@@ -433,7 +434,7 @@ def main():
433434
sys.exit(0)
434435

435436
else:
436-
task = {"type": "options", "name": "Main Menu", "options": {1: "Create New Simulation", 2: "Load Existing Simulation", 3: "View Plots/Stats", 4: "Exit"}}
437+
task = {"type": "options", "name": "Main Menu", "options": {1: "Create New Simulation", 2: "Load Existing Simulation", 3: "View Statistics", 4: "Exit"}}
437438
choice = menu.renderMenu(task)
438439
if choice == 1:
439440
Results_Manager.createNewSimulation()

0 commit comments

Comments
 (0)