Let each Mastermind player set their own code
A generated code takes away half the game. Whether to repeat a colour, whether to leave one out, whether to do the thing this opponent will not expect — those are real decisions, and no random number generator makes them. So a game now opens in a SETTING phase: each player chooses the code their opponent will have to break, one after the other, and the guessing starts once both are down. They choose in turn rather than at once because the engine only ever has one seat on the clock, and it costs nothing — neither can see the other's, so going second is not an advantage. The same move carries both: while the codes are being set it is your code, and after that it is a guess at theirs. Which one it means comes from the phase rather than from a flag on the move, because the phase is the thing that actually knows — a flag could disagree with it. An empty code used to mean one thing and now means two — not chosen yet, or chosen and hidden from the device this copy was sent to — so the state carries a flag per player. Whether the other player is ready is not a secret, and a screen has to be able to say "waiting for them" rather than sit blank. The computer sets a code at random and does not try to be clever about it: a code chosen to beat a particular solver has a pattern in it, and a pattern is the one thing a code should not have. That single choice is the only random in the app drawn from a source nobody else can see — every other one is seeded from the position so a host and a client agree, but a code seeded from anything on the wire could be worked out by the player who is meant to be guessing it. A code set on a guest's device reaches the host as a move and stops there: moves are intents sent to the host and are never relayed to the other player, so the only copy that reaches an opponent is redacted. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019Pr6B8xDDtJJcb6WJMw7Ud
This commit is contained in:
@@ -274,8 +274,8 @@ game:
|
||||
- [Chess](docs/RULES-chess.md)
|
||||
- [Checkers](docs/RULES-checkers.md) — **note the caveat about flying kings**
|
||||
- [Backgammon](docs/RULES-backgammon.md) — **note that there is no doubling cube**
|
||||
- [Mastermind](docs/RULES-mastermind.md) — played as a duel, both players
|
||||
guarding a code and breaking one
|
||||
- [Mastermind](docs/RULES-mastermind.md) — played as a duel: each player sets
|
||||
the code the other has to break
|
||||
- [Nine Men's Morris](docs/RULES-morris.md)
|
||||
- [Pirates and Bulgars](docs/RULES-pirates.md) — **note the caveats about the
|
||||
reconstruction**: the book the theme comes from could not be obtained, so the
|
||||
|
||||
Reference in New Issue
Block a user