Formal Specification
Bag of berries (Marriage trick-taking game) — Formal Specification
Finland · card · Confidence: low
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 2
# Marjapussi — AI-optimized specification
## General idea
A classical 4-player partnership trick-taking card game played with a 36-card pack. The game starts with no trump suit; trumps are established dynamically during play when a player who has won a trick leads a King or Queen of a suit while holding both, declaring a marriage (*avioliitto*). Play is governed by an unusually strict triple-obligation rule: players must follow suit, must overtake the highest card played if able, and must play trump when void in the led suit.
## Formal model
- **Abstraction taken:** None — direct discrete state machine model. The traditional physical deal and card-play rules form an exact discrete information-state game.
- **Player/agent count:** 4 agents arranged in two fixed partnerships (, ).
- **Turn model:** Strictly sequential trick play clockwise.
## Formal rules
R1. **Deck & Card Point Values:**
- 36-card deck: Ranks in four suits .
- Point values per card: , , , , , ranks . Total card points = 120.
- Rank hierarchy within each suit: .
R2. **Deal & Hand State:**
- Dealer deals 9 cards to each of the 4 players.
- Initial trump state is .
- Player to dealer's left leads the first trick.
R3. **Trick-Taking Constraints (Triple Obligation):**
- Let the led suit be .
- **Follow Suit (*Maantuntopakko*):** If a player holds card of , they must play a card of .
- **Overtaking (*Ylimenopakko*):** If playing , the player must play a higher rank than the highest card of currently in the trick, if able.
- **Trump (*Valttipakko*):** If void in and :
- The player must play a trump card if they hold one.
- If a trump has already been played in this trick, the player must play a higher trump than the highest currently in the trick, if able.
- **Discard:** If void in (and void in trumps, or if ), the player may play any card from hand.
R4. **Trick Resolution:**
- The trick is won by the highest trump played, or if no trumps were played, by the highest card of .
- The winner captures the 4 cards and leads the next trick.
R5. **Declaring Marriages (*Avioliitto*):**
- A player who has won at least one trick in the current hand may, when having the lead, declare a marriage if holding both and of suit .
- The player reveals both and and leads one of them.
- Suit immediately becomes the permanent for the remainder of the hand.
- The declaring partnership receives bonus card points: , , , .
- [gap-fill] If a trump is already established, a subsequent marriage in another suit may still be declared for points, but the original trump suit remains unchanged.
R6. **Hand Scoring & Game Points:**
- At the end of 9 tricks, each team sums captured card points + marriage bonuses.
- The team with higher points scores game points:
- Total points game point.
- Total points game points.
- Winning all 9 tricks (Slam / Marjapussi) game points.
- [gap-fill] If both teams tie in hand points (e.g. exactly 60–60 with no marriages), no game points are awarded for that hand.
- The first partnership to reach **12 game points** wins the match.
## Edge cases
- **Tie at the end condition:** If both teams reach points on the same hand, the team with the higher score wins; if still tied, additional hands are played until the tie is broken.
- **A player with no legal move:** Not applicable — a player always holds at least one card until hand completion, and the legal card filter is never empty.
- **Repetition / cycles:** Impossible — each hand strictly terminates in exactly 9 tricks as cards are depleted monotonically.
- **Simultaneous claims on the same resource or position:** Not applicable — play and marriage declarations are strictly sequential.
- **Player elimination mid-round; turn order repair:** Not applicable — fixed 4-player partnership structure with no elimination.
- **Resource exhaustion (pieces, tokens, space, time):** The 36-card deck is completely conserved. Hands cycle until 12 game points are achieved.
- **Termination guarantee: why the game provably ends:** In every non-tied hand, at least 1 game point is awarded. The probability of an infinite sequence of exact ties is zero, ensuring guaranteed termination.
## State representation
- **Persistent state:** Match scores in ; dealer index .
- **Per-hand state:** Current trump suit ; tricks won per player; captured card piles per team; marriage declaration logs.
- **Per-trick ephemeral state:** Lead player index; current cards in trick ; lead suit .
- **Observable information:** Imperfect information. Each player observes only their own hand, cards played in public tricks, and public marriage declarations.
## Action space
- `play_card(card)`: where `card` is a valid card from hand satisfying R3.
- `declare_marriage_and_lead(suit, lead_rank)`: valid only when on lead having won prior trick and holding both and of `suit`.
## Playability notes
- **Single-player-vs-AI:** Excellent. Natural implementation with 1 human player partnered with an AI against two opposing AI agents using standard imperfect-information tree search (ISMCTS / PIMC).
- **Group games ():** Standard is 4 players (2 vs 2). A traditional 3-player variant exists with a 3-card widow (*leski*), which is directly engine-implementable.
- **Physical-skill games:** Not applicable (pure card game).
- **What is lost in the adaptation:** The physical tactile shuffle, card table acoustics, and human facial tells/partner signaling.
## Implementation hints
- Implement the legal move generator as a strict boolean mask over the player's 9-card hand enforcing R3.
- Branching factor: Extremely small: legal cards per turn, rapidly dropping as the hand progresses (average branching factor ).
- Suggested first milestone: Implement single-hand trick resolution with 4 random agents and verify that all triple-obligation constraints (follow suit, overtake, trump) are 100% compliant.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Bag of berries (Marriage trick-taking game) (Finland). (n.d.). Games of Countries. https://gamesofcountries.com/games/fi-finland/marjapussi
@misc{gamesofcountries-fi-finland-marjapussi,
title = {Bag of berries (Marriage trick-taking game) (Finland)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/fi-finland/marjapussi}
}