From 2f56608c54bb6ae2148f2cb394eaa85d57d6ea96 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Wed, 15 Jul 2026 21:14:26 +0200 Subject: [PATCH] Make --num control the number of play games, not just training --num was declared as "Number of games to play" but the play() call used a hardcoded 10. Also give --num an int type so it works when passed on the CLI (range() would otherwise crash on the raw string), and make --verbose a store_true flag. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PQS7ZHqxQfy5DhKcz2gHau --- tic_tac_toe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tic_tac_toe.py b/tic_tac_toe.py index c88244b..f664851 100644 --- a/tic_tac_toe.py +++ b/tic_tac_toe.py @@ -59,9 +59,9 @@ def play(player_provider: PlayerProvider, k_max=10000, with_debug=False): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument("--verbose", default=False, help="Be verbose") + parser.add_argument("--verbose", default=False, action='store_true', help="Be verbose") parser.add_argument("--train", default=False, help="Train before play") - parser.add_argument("--num", default=5, help="Number of games to play") + parser.add_argument("--num", default=5, type=int, help="Number of games to play") parser.add_argument("--human", default=False, help="X-player is human") parser.add_argument("--load", default=True, help="Load experience from previous trainings") args = parser.parse_args() @@ -104,5 +104,5 @@ if __name__ == '__main__': else: pp = PlayerProvider(p_mx, p_mo) - play(pp, 10, args.verbose) + play(pp, N, args.verbose)