From 554ccfb1142b1b3e2b62dd7a1eb25f2b09bd3541 Mon Sep 17 00:00:00 2001 From: Auric Vente Date: Sat, 27 Jul 2024 00:43:30 -0600 Subject: [PATCH] Mods --- arguments.md | 10 ++++++++++ cromulant/ants.py | 12 ++++++++++-- cromulant/args.py | 2 ++ cromulant/argspec.py | 6 ++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/arguments.md b/arguments.md index 405588f..819d4a1 100644 --- a/arguments.md +++ b/arguments.md @@ -159,3 +159,13 @@ Make the arguments document and exit Default: False Action: store_true + +--- + +### score + +Show the score on triumph or hits instead of the total of each + +Default: False + +Action: store_true diff --git a/cromulant/ants.py b/cromulant/ants.py index 3a1f3e6..ea287a5 100644 --- a/cromulant/ants.py +++ b/cromulant/ants.py @@ -74,11 +74,19 @@ class Ant: status = self.status if self.method == Method.triumph: - total = f"({self.triumph} total)" + if Args.score: + total = f"(Score: {self.get_score()})" + else: + total = f"({self.triumph} total)" + status = f"{Config.triumph_icon} {Config.triumph_message} {total}" elif self.method == Method.hit: - total = f"({self.hits} total)" + if Args.score: + total = f"(Score: {self.get_score()})" + else: + total = f"({self.hits} total)" + status = f"{Config.hit_icon} {Config.hit_message} {total}" elif self.method == Method.think: diff --git a/cromulant/args.py b/cromulant/args.py index f49af1c..25255c2 100644 --- a/cromulant/args.py +++ b/cromulant/args.py @@ -26,6 +26,7 @@ class Args: normal_minutes: float = 0.0 slow_minutes: float = 0.0 argdoc: bool = False + score: bool = False @staticmethod def prepare() -> None: @@ -56,6 +57,7 @@ class Args: "normal_minutes", "slow_minutes", "argdoc", + "score", ] for n_item in normals: diff --git a/cromulant/argspec.py b/cromulant/argspec.py index d23dded..466ea50 100644 --- a/cromulant/argspec.py +++ b/cromulant/argspec.py @@ -166,3 +166,9 @@ class ArgSpec: action="store_true", info="Make the arguments document and exit", ) + + ArgSpec.add_argument( + "score", + action="store_true", + info="Show the score on triumph or hits instead of the total of each", + )