All projects Würfle · Write-up

Dice you throwWürfel zum Werfen

Würfle is the classic five-dice game for the afternoon meeting, alone or with friends: cobalt glass dice you flick across the table, every throw played through by the physics before it lands on the server’s numbers, and the paper block with one to six games.Würfle ist das klassische Würfelspiel mit fünf Würfeln für das Nachmittags-Meeting, allein oder mit Freunden: Würfel aus Kobaltglas zum Schnippen über den Tisch, jeder Wurf von der Physik durchgespielt, bevor er auf den Zahlen des Servers landet, und der Papierblock mit einem bis sechs Spielen.

wuerfle.ewolution.cloud Source

Type
Web appWeb-App
Stack
Svelte 5 · three.js · cannon-es · Node
Year
2026
Code
Public on GitHubÖffentlich auf GitHub

Five dice on the phone

Würfle is the classic five-dice game for the afternoon meeting, played alone or at a table with friends. Alone, it opens straight onto the dice, with up to three bots if you want company. A table gets a four-letter code (no vowels, so no code spells a word), a link and a QR code; there are no accounts, a name and a seal are enough, and a reload or a locked phone puts you back in your seat. The host picks how many games to play, one to six, the rules, a clock if the table wants one, and how well the bots play. The name is the game's own: würfeln with the Swabian -le the afternoon meeting's other games carry, and the box for five alike is called Würfle too.

The rules as printed

The rules follow the current leaflet of the German boxed game, checked line by line: thirteen rounds a game, up to three throws a turn, any dice kept between throws, and one box written after every turn. Ones to sixes count their pips, and 63 or more in the upper half earns a bonus of 35. A full house needs three and two of different numbers, so five alike is never one. The default is the German championship rules: any box may be crossed out at any time, and every further five alike scores 50 more, but only in a box it fits. The leaflet's basic rules and the joker rule of the American edition are the host's other choices. With two games or more there is also the house rule many families play: every column is open from the start, and each roll may go into any of them.

13Boxes a game, one written every turn.
63In the upper half earns the bonus of 35.
6Games at most, one column of the block each.

Throwing and keeping

The dice are cobalt glass with white pips, drawn with three.js on a dark table ruled like the paper block. Drag across the table and let go, and the dice fly off with your flick's speed and direction. Hold still a moment and they gather under your finger; wiggle, and they rattle in your hand. There is a button for anyone who prefers one. A tap on a die only keeps it, however long the finger rests, and dice let go without a flick slide back to where they lay. A tap puts a die on the rail at the back of the table, its number up and a gold ring drawn round it; a tap on the rail lets it go again. At a table, everyone sees each throw land and each die kept as it happens.

Played through before it's shown

The server rolls the numbers; the page throws the dice. To make both agree, every throw is played through before anyone sees it. When the dice leave a hand, the physics runs the whole throw in a few milliseconds and records every step, then the recording plays. The page knows which face of each die will end on top, and turns that die's faces so it lands on the number the server rolled, swapping two pairs of opposite faces so they still add up to seven. The thrower's page sends where its dice left the hand, and every other page plays the same throw from there. A throw is over once every die has been still for a tenth of a second: about one and a half seconds, measured over four hundred throws. A die left leaning on a wall or on another die is laid flat on a free spot.

The block

The score sheet is laid out like the paper one: the boxes down the side, one column per game, the sums where the paper has them, and all the games added up at the bottom. On a phone the table takes the whole screen above the throw button, with only the players' totals below it. After any throw, Write folds the table down to a strip of the five dice and brings the block up; after the third throw it comes up by itself, and the table opens again for the next turn. While you may write, the current column shows in pencil what the dice would score in each open box. A tap chooses a box, and the gold check mark beside it writes it, as does a second tap. The header stays put while the rows scroll, and a tap on a player's name opens their block. On a wide screen the block sits beside the table.

Bots in three ranks

The bots play at the same three ranks as the other games here. The apprentice keeps the most common face and writes whatever scores most right now. The journeyman weighs each box's points against what the box is likely to be worth later, and plays for the bonus. The master looks ahead over every possible keep and every outcome of the throws left in the turn, with the journeyman's judgement at the end, and decides in about a millisecond. Over two thousand games alone they average about 195, 227 and 244 points. At a table they show the dice they keep for a moment before they throw the rest.

Alone, and offline

The rules and the bots are plain modules that the server and the page share, so a game alone runs entirely in the page and keeps playing without a connection once the app is installed. It's saved on the phone as it goes, and finished games go into a small record of the best game and how many were played. The physics and the drawing are the biggest part of the app, so they arrive after the first screen. A script plays a whole match through the real page at phone size, a host and a guest and a bot, and checks that nothing on the table jumps. The page is in German and English and installs to a home screen.

Fünf Würfel auf dem Handy

Würfle ist das klassische Würfelspiel mit fünf Würfeln für das Nachmittags-Meeting, allein oder an einem Tisch mit Freunden. Allein geht es sofort los, auf Wunsch mit bis zu drei Bots. Ein Tisch bekommt einen Code aus vier Buchstaben (ohne Vokale, damit kein Code ein Wort ergibt), einen Link und einen QR-Code; Konten gibt es keine, ein Name und ein Wappen reichen, und nach einem Neuladen oder einem gesperrten Handy sitzt man wieder auf seinem Platz. Der Gastgeber wählt, wie viele Spiele gespielt werden, eins bis sechs, die Regeln, auf Wunsch eine Uhr und wie gut die Bots spielen. Der Name gehört dem Spiel selbst: würfeln mit dem schwäbischen -le, das auch die anderen Spiele des Meetings tragen, und das Feld für fünf gleiche heißt ebenfalls Würfle.

Die Regeln wie gedruckt

Die Regeln folgen dem aktuellen Faltblatt des deutschen Brettspiels, Zeile für Zeile geprüft: dreizehn Runden pro Spiel, bis zu drei Würfe pro Zug, zwischen den Würfen beliebig viele Würfel behalten, nach jedem Zug ein Feld eintragen. Einser bis Sechser zählen ihre Augen, und 63 oder mehr oben bringen 35 Bonus. Ein Full House braucht drei und zwei verschiedene Zahlen, fünf gleiche sind also nie eins. Voreingestellt sind die Regeln der deutschen Meisterschaft: Jedes Feld darf jederzeit gestrichen werden, und jedes weitere Würfle bringt 50 Punkte mehr, aber nur in einem Feld, in das es passt. Die Grundregel des Faltblatts und die Joker-Regel der amerikanischen Ausgabe stehen dem Gastgeber zur Wahl. Bei zwei Spielen oder mehr gibt es auch die Hausregel, die viele Familien spielen: Jede Spalte ist von Anfang an offen, und jeder Wurf darf in jede davon.

13Felder pro Spiel, jeden Zug eins.
63Oben bringen den Bonus von 35.
6Spiele höchstens, jedes eine Spalte im Block.

Werfen und behalten

Die Würfel sind aus Kobaltglas mit weißen Augen, gezeichnet mit three.js auf einem dunklen Tisch, liniert wie der Papierblock. Über den Tisch ziehen und loslassen, und die Würfel fliegen mit Tempo und Richtung des Wischs davon. Einen Moment still halten, und sie sammeln sich unter dem Finger; ein Wackeln, und sie klappern in der Hand. Für alle, die einen Knopf lieber mögen, gibt es einen. Ein Tippen auf einen Würfel behält ihn nur, egal wie lange der Finger liegt, und Würfel, die ohne Schwung losgelassen werden, gleiten zurück an ihren Platz. Ein Tippen legt einen Würfel an die Leiste hinten am Tisch, die Zahl oben, mit einem goldenen Kreis darum; ein Tippen auf der Leiste gibt ihn wieder frei. Am Tisch sehen alle jeden Wurf landen und jeden behaltenen Würfel, während es passiert.

Erst durchgespielt, dann gezeigt

Der Server würfelt die Zahlen, die Seite wirft die Würfel. Damit beides übereinstimmt, wird jeder Wurf durchgespielt, bevor ihn jemand sieht. Verlassen die Würfel eine Hand, rechnet die Physik den ganzen Wurf in wenigen Millisekunden durch und zeichnet jeden Schritt auf, dann läuft die Aufzeichnung ab. So weiß die Seite, welche Seite jedes Würfels oben liegen bleibt, und dreht dessen Seiten so, dass er auf der Zahl landet, die der Server gewürfelt hat; dabei tauschen zwei Paare gegenüberliegender Seiten, damit sie weiter zusammen sieben ergeben. Die Seite der werfenden Person schickt mit, wo ihre Würfel die Hand verlassen haben, und jede andere Seite spielt von dort denselben Wurf. Ein Wurf ist vorbei, wenn jeder Würfel eine Zehntelsekunde still liegt: etwa anderthalb Sekunden, gemessen über vierhundert Würfe. Ein Würfel, der an der Wand oder auf einem anderen lehnt, wird auf einem freien Platz flach hingelegt.

Der Block

Der Spielblock sieht aus wie der aus Papier: die Felder an der Seite, eine Spalte pro Spiel, die Summen, wo das Papier sie hat, und unten alle Spiele zusammengezählt. Auf dem Handy nimmt der Tisch den ganzen Bildschirm über dem Würfeln-Knopf ein, darunter stehen nur die Summen der Spieler. Nach jedem Wurf klappt Eintragen den Tisch zu einem Streifen mit den fünf Würfeln zusammen und holt den Block hoch; nach dem dritten Wurf kommt er von selbst, und zum nächsten Zug öffnet sich der Tisch wieder. Solange man eintragen darf, zeigt die aktuelle Spalte mit Bleistift, was die Würfel in jedem freien Feld bringen. Ein Tippen wählt ein Feld, und der goldene Haken daneben trägt es ein, ein zweites Tippen ebenso. Die Kopfzeile bleibt stehen, während die Zeilen scrollen, und ein Tippen auf einen Namen öffnet den Block dieser Person. Auf einem breiten Bildschirm steht der Block neben dem Tisch.

Bots in drei Rängen

Die Bots spielen in denselben drei Rängen wie in den anderen Spielen hier. Der Lehrling behält die häufigste Zahl und trägt ein, was gerade am meisten bringt. Der Geselle wägt die Punkte eines Feldes gegen das ab, was es später wahrscheinlich wert ist, und spielt auf den Bonus. Der Meister rechnet jedes mögliche Behalten und jeden Ausgang der übrigen Würfe des Zugs durch, am Ende mit dem Urteil des Gesellen, und entscheidet in etwa einer Millisekunde. Über zweitausend Spiele allein kommen sie im Schnitt auf etwa 195, 227 und 244 Punkte. Am Tisch zeigen sie die Würfel, die sie behalten, einen Moment lang, bevor sie den Rest werfen.

Allein, auch offline

Die Regeln und die Bots sind einfache Module, die sich Server und Seite teilen, also läuft ein Spiel allein ganz in der Seite und geht nach der Installation auch ohne Verbindung weiter. Es wird unterwegs auf dem Handy gespeichert, und fertige Spiele landen in einer kleinen Bilanz mit dem besten Spiel und der Zahl der gespielten. Physik und Zeichnung sind der größte Teil der App, deshalb kommen sie erst nach dem ersten Bildschirm. Ein Skript spielt eine ganze Partie durch die echte Seite in Handygröße, mit Gastgeber, Gast und Bot, und prüft, dass auf dem Tisch nichts springt. Die Seite ist auf Deutsch und Englisch und lässt sich auf den Home-Bildschirm legen.