Skip to content

πŸ’‘ [Feature]: enhance Ai efficiency and add game replay functionalityΒ #713

@Facelessism

Description

@Facelessism

❓ 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.

  • I am a registered GSSoC 2026 contributor.
  • I would like to implement this feature myself.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions