snackbox

Three small tools for settling something

Who buys the coffee, who goes first, which of the six lunch places wins. Snackbox has one page for each of those arguments. No sign-up, no app, nothing saved on a server: every draw happens in your own browser and disappears when you close the tab.

How the picks are made

All three tools draw from crypto.getRandomValues, the random number generator the browser also uses for cryptography. That matters more than it sounds: the usual Math.random is only required to look random, and in some browsers it has produced visible patterns. For deciding who pays for lunch that hardly matters, but there was no reason to pick the weaker option.

Turning a random number into a fair choice takes one more step. Asking for a random value and taking the remainder skews the result towards the low numbers, because the range rarely divides evenly. Every tool here uses rejection sampling instead: it throws away the values that fall in the uneven tail and draws again, so each outcome is equally likely.

The animations are decoration. The lottery balls bouncing around the drum do not decide anything; the numbers are drawn first and the machine is told which ball to spit out. That keeps a slow phone from producing different odds than a fast laptop.

Nothing leaves your browser

There is no account, no database and no server that sees your entries. The names you type stay on your device. Your last few spins and draws are kept in the browser's own storage so the page remembers them when you come back, and clearing them is a single button on each page. The only third party involved is Google Analytics, and it only runs if you agree to it. The privacy policy spells this out.

Why these three

They cover the three shapes a small group decision usually takes. Amidakuji matches people to outcomes, so it works when the answers differ: one person buys, everyone else drinks. The wheel picks one name out of a list, which is what you want for a giveaway or a turn order. The lottery machine is not really a decision tool at all; it is there because watching numbered balls drop is satisfying, and picking six numbers for a ticket is a question people genuinely ask.