← journal

Dreidel

12/5/2026

A dreidel is a four-sided top. During Hanukkah it is spun for gelt, the chocolate coins (or nuts, or pennies, or whatever is on the table) that everyone has anted into the pot. The letters on its sides are the first letters of nes gadol haya sham, "a great miracle happened there", and in the game they stand for Yiddish words that say what the spin did.

FaceLetterStands forRule
נNunnisht (nothing)Nothing happens.
גGimelgantz (all)Take the whole pot.
הHeyhalb (half)Take half the pot, rounded up.
שShinshtel arayn (put in)Put one piece in the pot.

Everyone puts one piece in to start, and again whenever the pot is down to one piece or empty. Run out of gelt when a payment comes due and you are out. The last player holding gelt wins the table.

Play with friends

Open a table and send the code around. Every spin is rolled by the server, so nobody's browser gets to pick its own luck.

Play against the house

The same rules engine the server runs, in this tab, against a few bots. No connection needed.

server

How it is built

The rules live in one small TypeScript package with no dependencies beyond zod: pure functions from a game state and a spin to the next state, plus a controller that owns a table and spins on behalf of bots and players who have dropped off. The game server, a Node process behind a WebSocket, holds one controller per table and rolls every spin itself, so the browser only ever asks to spin and is told what happened. The offline mode above is that same controller running in this tab, which is what lets the page work with the server down.

Messages in both directions are zod schemas shared by both ends, so the server rejects anything malformed and the page rejects anything it does not understand. The server is deployed on Disco from this same repository, and its Caddy proxy passes the WebSocket upgrade straight through.