Formal Specification
Basra (Egyptian Card Game) — Formal Specification
Egypt · card · Confidence: medium
← Back to game pageImplementation Suitability
Suitability: engine-readyFidelity: directGap-fills: 1
# Basra — AI-optimized specification
## General idea
A turn-based card fishing game played with a 52-card deck where agents capture table cards by rank matching, sum subset partitioning, or wildcard sweeps (Jacks and 7 of Diamonds). Clearing the table with a non-Jack play scores a high-value *Basra* bonus.
## Formal model
- **Abstraction taken:** None; standard discrete card game mechanics.
- **Player/agent count:** 2 agents (Agent 0 and Agent 1).
- **Turn model:** Sequential alternating card plays across 6 dealing phases of 4 cards per deal.
## Formal rules
R1. Setup: A standard 52-card deck is shuffled. 4 cards are dealt face-up to `table_cards`. If any Jack or 7♦ is dealt to table, it is replaced and reshuffled into deck. Each agent is dealt 4 private cards.
R2. On a turn, the active agent plays 1 card from hand to the table.
R3. Legal capture calculation:
- If is a Jack (rank J) or 7♦: captures all `table_cards`.
- If is rank K or Q: captures all table cards of matching rank.
- If has numeric value (Ace=1): captures all table cards with rank value , plus all subsets of numeric table cards whose values sum to .
R4. Basra condition:
- If a capture is made that removes all cards from `table_cards` (leaving table empty):
- If is a Jack: no Basra bonus (0 bonus), UNLESS table held exactly 1 Jack prior to the play, which scores a Jack-Basra (+30 points).
- If is not a Jack: scores a standard Basra bonus (+10 points).
R5. If no capture is possible, card is added to `table_cards`.
R6. Dealing cycles: When hands are empty, each agent is dealt 4 new cards from the deck until deck is empty (total 52 cards played).
R7. Deal conclusion: Remaining table cards after the 52nd card are awarded to the agent who made the last capture.
R8. Scoring:
- Most cards (>26): +30 points. If tied (26-26), 0 points.
- 7♦ (Komi): +2 points.
- 10♦: +3 points.
- 2♣: +1 point.
- Each Ace: +1 point (4 points total).
- Basra points accumulated during deal are added to score.
R9. [gap-fill] Match win threshold: Target score is 101 points. If both agents exceed 101 in the same deal, higher score wins; if tied above 101, an additional deal is played.
## Edge cases
- Tie at the end condition: If both reach ≥101 points with equal totals, another complete deal is played to determine the winner.
- A player with no legal move: Not applicable; an agent with cards in hand can always play any card (discarding to table if no capture).
- Repetition / cycles: Impossible; every play strictly decrements the 52-card supply.
- Simultaneous claims on the same resource or position: Turns are strictly sequential.
- Player elimination mid-round; turn order repair: Not applicable; 2 fixed agents play the full match.
- Resource exhaustion (pieces, tokens, space, time): Deck strictly empties after 52 card plays.
- Termination guarantee: Each deal consumes 52 cards; scores monotonically increase each deal towards 101.
## State representation
- Persistent state: `match_scores`: `{AGENT_0: int, AGENT_1: int}`.
- Per-deal state:
- `deck`: list of remaining cards.
- `table_cards`: list of face-up cards.
- `hands`: `{AGENT_0: list[Card], AGENT_1: list[Card]}` (private information).
- `captured_cards`: `{AGENT_0: list[Card], AGENT_1: list[Card]}`.
- `basra_counts`: `{AGENT_0: int, AGENT_1: int}`.
- `last_capturer`: `AGENT_0 | AGENT_1 | None`.
- Observable information: Table cards, discarded cards, public captured counts, and Basra events are public; opponent's hand is private.
## Action space
- `play_card(card_index)`: select which of the cards in hand to play.
## Playability notes
- Single-player-vs-AI: Engine-ready; standard Information Set MCTS (ISMCTS) or POMCP operates naturally.
- Group games (n>4): Easily adapted to 4 players in 2 fixed partnerships (2v2).
- Physical-skill games: Direct translation; fully discrete logical rules.
- What is lost in adaptation: Physical coffeehouse card-slamming flair and table banter are lost.
## Implementation hints
Low complexity. Subset-sum for table card combinations is trivial since maximum table size is cards and target value is . First milestone: implement card dealing, subset-sum capture validator, and Basra bonus trigger.
Download as JSON
Download the full game corpus entry for this game as structured JSON.
Download JSONCite this page
Basra (Egyptian Card Game) (Egypt). (n.d.). Games of Countries. https://gamesofcountries.com/games/eg-egypt/basra
@misc{gamesofcountries-eg-egypt-basra,
title = {Basra (Egyptian Card Game) (Egypt)},
year = {n.d.},
publisher = {Games of Countries},
url = {https://gamesofcountries.com/games/eg-egypt/basra}
}