Skip to content

Resignation offer/decline flow - #146

Merged
nodots merged 2 commits into
developmentfrom
feature/resignation-offer
Jul 27, 2026
Merged

Resignation offer/decline flow#146
nodots merged 2 commits into
developmentfrom
feature/resignation-offer

Conversation

@nodots

@nodots nodots commented Jul 26, 2026

Copy link
Copy Markdown
Owner

resign() completed the game unilaterally at the resigner's chosen points, letting a player facing a certain gammon escape for 1 point. Resignation is now an offer the opponent must answer, parallel to double/take:

  • offerResign(game, player, points) records a pending resignationOffer (types 1.0.5); stateKind unchanged while the offer is open
  • canRespondToResign / acceptResign / declineResign: only the opponent may respond; accept completes via the existing resign scoring (cube multiplier, Jacoby); decline clears the offer and play resumes
  • RobotAIProvider gains optional decideResignationResponse (accept/decline); callers treat a provider without it as accepting (pre-offer-flow behavior)

resign() remains as the completion step. TDD: 14 new tests in resignation-offer.test.ts; the 13 cube-resign characterization tests are untouched and green. Full suite: no new failures (the 3 failing Board/gnuPositionId suites crash on import on the development baseline too).

Depends on types PR nodots/backgammon-types#69 (published as 1.0.5).

nodots added 2 commits July 26, 2026 15:18
resign() completed the game unilaterally at the resigner's chosen points,
letting a player facing a certain gammon escape for 1 point. Resignation
is now an offer the opponent must answer, parallel to double/take:

- offerResign(game, player, points): records a pending
  resignationOffer (new optional game field, types 1.0.5); stateKind
  unchanged while the offer is open
- canRespondToResign / acceptResign / declineResign: only the opponent
  may respond; accept completes via the existing resign scoring (cube
  multiplier, Jacoby); decline clears the offer and play resumes

resign() remains as the completion step and for callers that still
complete directly.
Providers may answer a pending resignationOffer with accept/decline.
Optional: callers treat a provider without it as accepting, which is
the pre-offer-flow behavior.
@nodots
nodots merged commit 50793d1 into development Jul 27, 2026
1 check failed
@nodots
nodots deleted the feature/resignation-offer branch July 27, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant