summaryrefslogtreecommitdiff
path: root/__main__.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-03 15:05:55 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-03 15:05:55 +0200
commit729455edf7fe92ba46ba2ea274bc3b5f4879b71b (patch)
treef300018c08775323f1cab4699633767500710b59 /__main__.py
parentb45017cdb4d9f723202b2f110e28029f974a7c86 (diff)
Adding tests to whole app.
Diffstat (limited to '__main__.py')
-rw-r--r--__main__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/__main__.py b/__main__.py
index 6dad3f8..c98633b 100644
--- a/__main__.py
+++ b/__main__.py
@@ -27,13 +27,19 @@ if args.file is None:
del app
else:
run_count = 0
- print(f"Pelataan miinaharavat tiedostosta {args.file}")
with open(args.file, "r", encoding="utf-8") as bfile:
board = []
while True:
line = bfile.readline()
if not line or (line[0]!='.' and line[0]!='@'):
if board:
+ win_percent = (100*win_count/run_count) if run_count else 0
+ print(end=
+ f" \rAjo ...{args.file[-18:]:} ({run_count+1}): "
+ f"({win_percent:.1f}%).."
+ )
+ if not args.quiet:
+ print()
args.board = board
app = App(args)
win_count += app.run()