Independent project · 2026
Sole developer · Playable product · private online beta · 2026
Chkobba: one rules engine for every way to play
A Tunisian card game where one pure rules engine drives local play, bots, replays, simulations and private online rooms.

Background
Chkobba has hidden hands and captures with many legal combinations. If local play, bots, replays and online rooms each tracked the rules separately, they would drift apart.
Key decision
Every mode calls one pure function, applyAction(state, action). Bots and online players get a filtered view, so they never see other hands or the deck order.
React draws the table. Bots play from a restricted view and are compared in seeded arena runs. Online, a Durable Object per room checks each move and sends every player their own view.
React · TypeScript · Vite · Vitest · Cloudflare Workers · Durable Objects · WebSockets · Glicko-2
Overview
One rulebook, four callers. It follows a move from the deal to each player’s screen; pick a step to stop on it.
Shuffle and deal
A seeded RNG shuffles and deals into the full game state: every hand, the deck order and the seed.
A move at the local table
Tapping a card and a capture sends PLAY_CARD to applyAction. The reducer is pure: the same state and action always give the same result, and an illegal move throws.
Bots see a projection
A bot never reads the state. createBotView gives it its own hand, the other players’ card counts, and the cards it has not seen yet.
The bot plays like a player
The bot picks one legal move from that view and sends the same PLAY_CARD action through the same reducer.
The bot arena
The arena runs bot-only games on seeded schedules, with mirrored seeds and seat swaps, and rates bots with Glicko-2. It uses the same reducer.
An online intent is checked
Online, each room is one Cloudflare Durable Object. Before applyAction runs, it checks that the client is in the room, the actionId is new, the game is in play, it is this seat’s turn, and the client owns the seat. Anything else is rejected.
Each player gets their own view
The new state is redacted per player before it is sent: other hands become hidden placeholders and the seed is removed. Each browser gets its own ROOM_STATE over its WebSocket.
Where it stands
The game is playable online. 133 tests cover the rules, bots, localization and full online rounds, and any game can be replayed from its seed.
Online rooms are in beta, and bot ratings are used for tuning. Next are Safari and Firefox checks and a native speaker’s review of the Tunisian wording. The source is private.

