β Problem Statement
The current games/Dots-Boxes-AI evaluates moves by repeatedly scanning the entire board to detect completed or dangerous boxes. While functional, this approach becomes increasingly inefficient as the board size grows and resulting in unnecessary computations during AI turns. Also, the game terminates immediately after a match, forcing users to rerun the script manually to start another game.
π Proposed Enhancement
- optimize AI box detection by limiting the evaluations to only the boxes being affected by the current move.
- add a replay option after game completion.
π οΈ Suggested Implementation
- Refactor AI helper functions to avoid full-board scans during move evaluation.
- Move the main game execution into a
run_game() function and add a simple (y/n) loop after the game ends.
β Problem Statement
The current
games/Dots-Boxes-AIevaluates moves by repeatedly scanning the entire board to detect completed or dangerous boxes. While functional, this approach becomes increasingly inefficient as the board size grows and resulting in unnecessary computations during AI turns. Also, the game terminates immediately after a match, forcing users to rerun the script manually to start another game.π Proposed Enhancement
π οΈ Suggested Implementation
run_game()function and add a simple(y/n)loop after the game ends.