Skip to content
Project number
Project / 016
Year
2026
Category
Product
Status
Active · Live

Balang

A Malaysian probability party game. Everyone can see what is in the jar; nobody knows the order it comes out in. Read the odds, bet on secret predictions, and play friends in rooms that need no server.

Origin
Social experience → Game
Inspired by
Bag of Chips (board game)
Type
Multiplayer party game · web / PWA
Tagline
Agak. Risiko. Menang.
Stack
React 19 · TypeScript · Vite · PeerJS (WebRTC) · Vitest
Live
balang.madebyrazeen.com

01 /Overview

The balang is the game.

A simple social game enjoyed with friends became the starting point for designing a Malaysian digital probability and prediction game.

Balang is built around one shared jar of familiar Malaysian kuih. Players know exactly what goes in. As tokens are drawn, they keep reassessing the odds, drop predictions that are becoming unlikely, lock their final choices, and decide whether to risk KAW-KAW.

The goal was a game that is easy to understand in the first round, strategic without needing advanced maths, and fast enough that people want another match straight away.

02 /The rules

One round, six steps.

  1. Read the jar
  2. Get 6 cards
  3. Shake and draw
  4. Discard
  5. Place 3: one negative (KAW-KAW?)
  6. Score
  1. 01Read the jar

    25 tokens of five kuih, chosen at random from a pool of ten each round. The counts are public; the order is secret.

  2. 02Predict

    Each player gets six secret prediction cards, such as “more onde-onde than dodol” or “muruku exactly 3”. Harder predictions are worth more.

  3. 03Draw

    Players take turns to shake the jar. 14 tokens come out and 11 stay in.

  4. 04Discard and lock

    After draw 5 you drop two cards and after draw 9 one more. After draw 12 all three remaining cards count: you place one on the negative side, where it costs you its value if it comes true.

  5. 05KAW-KAW

    You may go KAW-KAW on one positive card: double its value if it comes true, lose its value if it does not.

  6. 06Win

    Positive cards that come true score their value; a negative card that comes true loses it. Three rounds; the highest total is JUARA.

03 /Gameplay

A real round, start to finish.

The BALANG walkthrough: open a room, read the jar, shake and draw, let go of the long shots, dare to double and see every card resolve.

Captured from a real game on a local build, played against the built-in computer players.

  1. BALANG round start: the jar contents counted by kuih type and the six secret prediction cards dealt to the player

    01Observe: everyone sees what is in the jar; each player gets six secret prediction cards.

    Real product
  2. BALANG game table: players and scores, the jar, the draw track, the live jar count and the player prediction cards

    02The table: players take turns to draw, and the jar count updates after every token.

    Real product
  3. BALANG discard step: two prediction cards marked for discarding after five draws

    03Reassess and discard: predictions that are becoming unlikely are dropped.

    Real product
  4. BALANG KAW-KAW choice: double the value of one positive card, at the risk of losing it, or play safe

    04KAW-KAW: double one positive card's value, at the risk of losing it, or play safe.

    Real product
  5. BALANG round result: a negative card that did not come true, a KAW-KAW card that did, one card wrong, the fourteen drawn tokens and the scores

    05Result: each placed prediction is checked against the fourteen tokens drawn.

    Real product
BALANG final placement: one of the last three prediction cards placed on the negative side with twelve tokens drawn

After twelve draws: one of the last three cards goes on the negative side.

Real product
BALANG game table on a phone: the jar, token counts, draw track and swipeable prediction cards

The same table on a phone.

Real product

04 /System architecture

No backend, on purpose.

02 / PROCESSPure TypeScript state machine: draw order, hands, scoring, bots.

The host’s browser holds every secret; each guest only ever receives its own filtered view.

05 /Build

Built to be fair and to survive dropouts.

  1. 01Engine separate from UI

    src/engine holds the game logic, prediction types, probability pricing, bots and statistics; the React UI only renders state.

  2. 0212 prediction types

    Each card type has its own evaluation and an “already decided” check, so cards can be stamped DAH PASTI or DAH GAGAL as soon as the outcome is certain.

  3. 03Probability-priced rewards

    Rewards come from the card’s chance of success at deal time, estimated with Monte Carlo simulation, and all balancing values live in one config file.

  4. 04Bots

    Bots play empty seats, and take over a guest’s turns if they disconnect until they rejoin from the same browser.

  5. 05Turn timer

    If the host sets a time limit and it runs out, a token is drawn or a card chosen automatically.

  6. 06Assets pipeline

    Sprites are sliced from the concept sheets by a Python script, so the art can be regenerated.

06 /Balance

Letting bots test the maths.

A reward table that looks fair on paper can still be broken in play. Because the engine runs without the UI, bots can play whole matches on their own and report how the rewards behave. The first report showed the game was too forgiving: about three in four locked cards came true, so the final choice carried little risk. That led to the final rules, borrowed from the board game Bag of Chips: every final card counts and one must go on the negative side. In the same bot matches, that negative card now costs its owner points in about a third of rounds.

07 /What I learned

Small game, same lessons.

  1. 01Put the rules in one place

    A pure engine with tests made every UI change safe and makes balance testing possible.

  2. 02Trust boundaries matter even in games

    Keeping secrets on the host and sending filtered views stopped the easiest way to cheat.

  3. 03Numbers should feel honest

    Each card is priced from its real chance of coming true, so a risky prediction pays more because it is genuinely less likely.

08 /Next project

LeadSightz

Cursor × Anthropic Hackathon 2025: sales automation with Claude for intelligent lead management and insights.