How The Rice Grain Game works

The Rice Grain Game

The rules the game actually runs on: what is in the tray, how a toss behaves, what counts as clean, and how a round is scored.

The round

One bilao, sixty seconds. Every round deals a fresh tray, so no two are the same: the grain count is drawn between 18,000 and 24,000, and the impurities are 7% to 12% of the tray, split 77% husk, 15% paddy, 8% stones. A tray therefore opens somewhere between 88% and 93% purity.

A round ends one of three ways. The clock runs out with the tray at the purity bar or better and you win, it runs out below the bar and you lose, or more rice goes over the rim than the mode allows and you lose with the tray wherever it stands. A tray with every impurity out ends the round on the spot.

Winning is a purity bar, not an empty tray

Purity is the share of what is on the tray that is rice. A round is won at 99.5%, compared on the one decimal the results card prints, so a card that reads 99.5% is a card that won. A few grains left in a tray that clean do not fail it.

The bar is judged when the clock reaches zero. Crossing 99.5% does not stop the round, so the rest of the minute is yours to spend on a spotless tray and the clean bonus. A tray that slips back under the bar by the buzzer is a loss, and so is one that spilled.

What that bar tolerates depends on how much rice the round dealt, because the leftover impurities are measured against the rice around them.

Impurities a 99.5% tray may still hold
Rice dealtGrains toleratedShare of rice
18,000900.50%
20,0001000.50%
22,0001100.50%
24,0001210.50%

Against the 1,355 to 3,273 impurities a round deals, that means taking 93% to 96% of them out. A tray with every single impurity gone is still worth more: the clean bonus is paid only for a tray with nothing left in it.

How a toss behaves

A toss lifts the bed a centimetre rather than a hand's height, and the air does the separating. Tilting steers both the pour and the air, so the two together decide where the husk goes.

Husk is the awkward part. Each grain holds on to the bed with its own grip, a toss below about 0.55 takes none of it at all, and above that each grain lets go on its own roll. One good toss therefore frees a share of what is lying on top and leaves the rest, and husk that falls back can sink under the rice again. The last of the husk is the work, not the first.

Only a grain that was already on top of the bed can be picked up by the air, so a toss uncovers what is under the rice and the next toss carries it away. Paddy and stones are too heavy to be winnowed at all: about a third of the paddy will not blow away under any toss, so it has to be picked out by hand along with every stone.

Rice over the rim

The braid is taller than a grain lying on the weave, so tipping the tray piles the bed against it and throws nothing out. A toss that lifts rice above the braid leaves the outer ring with nothing in front of it but air, and a grain that drifts past the braid's foot while it is up there is gone. It lands on the table, where you can watch it go.

Each mode allows a share of the rice it dealt, and losing more than that ends the round as a loss. One toss can take a handful at most: about four grains at the TOSS button's strength and about twenty at a full shake. A round hammered flat out runs out of rice before the tray is clean.

What each mode allows over the rim
ModeAllowanceOn a 20,000-grain tray
Easynone, the braid is shut0
Medium2% of the deal400
Hard1.2% of the deal240

Impurities stay spread out

Husk, paddy and stones are dealt one to a cell rather than at random, because random points clump and a tray that opens with every stone in one corner is a different game. While the bed moves they are pushed away from each other too, so none of them gathers into a patch that one swept finger would clear.

Scoring

A round scores 100 for every impurity taken off the tray, 25,000 for a tray with every impurity gone, and the purity percentage times 100. A spilled round keeps 40% of its impurity points and nothing else. Wins in a row multiply the whole thing by 1.05 each, up to 1.5 times after ten, and a loss starts the streak again at zero.

A worked medium round
OutcomeScore
Clean tray, at 100.0%235,000
Won at the bar, 100 impurities left199,950
Time up at 200 impurities left190,000 plus purity
Over the rim: 40% of the picks80,000

Scores are computed by the server from the counts the round started and ended with, so the page never sends a score. The public board keeps a best run per player and difficulty.

Difficulty

Difficulty changes how dirty the tray is, how deeply the impurities are buried, how far a phone tilt moves the bed, and how much rice the braid will let go.

What each mode changes
ModeImpuritiesBurialTiltOver the rim
Easy7-8.5%shallow72%none
Medium8-10%regular100%2%
Hard10-12%deep120%1.2%

Controls

Tilt the phone to pour the bed and the air, or drag the side knob instead. Shake to toss, or press TOSS. Tap or wipe a surfaced paddy or stone to pick it out. Pinch to zoom, double tap for 2.5 times, and tap the level ring to set the angle you are holding as flat.

On a keyboard: arrows tilt, space tosses, r restarts the round, c levels the tray, and d toggles diagnostics.

These are the numbers the build ships with. The simulation that enforces them is src3d/sim.js, and the scoring is server.ts; both are in the repository if you want the exact figures.