Skip to content

Stalemate rule #9

Description

@nonfamousd

If neither snake has collected any fruit within game-timeout seconds, end the current game. The winner is the longest snake, or if equal, the game is a draw.

(Likely only needed when there is a fruit with a 0 (infinite) lifetime and the players are bots with cautious strategies.)

Activity

  1. revodavid commented on Mar 10, 2026

    @revodavid
    Owner

    The status message on completion of the game should either be:

    Stalemate. wins the game.

    or

    Stalemate. Draw game.

  2. revodavid commented on Mar 10, 2026

    @revodavid
    Owner

    Status update:

    • The stalemate timeout logic in main.py has been changed to avoid importing time.
    • Elapsed no-fruit time is now derived from tick counts multiplied by the configured speed/tick_rate, while game-timeout remains expressed in seconds.
    • This keeps hot-reload-safe config behavior and avoids wall-clock timing inside the game loop.
    • I also updated the client-side competition-complete entry-screen countdown/status text to show Next competition begins in: <Ns> during the reset delay.

    I have not closed this yet because the existing python tests/test_tournament.py check is currently hanging, so there is still follow-up verification/investigation to do.

  3. revodavid commented on Mar 10, 2026

    @revodavid
    Owner

    Implementation reference:

    • Server commit: f614949 (Add stalemate timeout and Sleepy Snake bot)
    • Client commit: 64d2a89 (Improve competition status messaging)
    • Branch: v401

    The server commit implements the stalemate rule and includes end_reason in the gameover payload. The client commit updates the player/observer status text so stalemate wins mention that the winner was longer.

  4. revodavid commented on Mar 13, 2026

    @revodavid
    Owner

    @copilot, review this issue and verify that it was implemented in a previous commit. Update this issue accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions