UR FINKEL

The Royal Game of Ur — a ~4,600-year-old board game — written in C and 6502 assembly for the Commodore Plus/4.

If the tab reloads itself, that is Safari running out of memory — the page comes back here, not into another attempt.

If it crashes or reloads on your phone

These take effect the next time you press play, and are remembered on this device only. Whichever one lets the game run is also the answer to what went wrong — the line below is that answer in a form worth sending me.

Downloads — four ways to take it away. Each card goes to the file it names; clicking a binary there saves it, while the checksum files open in the browser so you can save one beside the download and check it arrived whole.

To check a download arrived intact, save its .sha256 beside it and run shasum -a 256 -c urfinkel.prg.sha256. What built these — compiler, version and the exact command — is in CHECKSUMS.txt.


Code — the whole repository

The four files above are built from, and committed to, github.com/vonglurt/urfinkel — along with the Makefile, the tests, the hooks and the reports that none of the archives carry. This is the same panel GitHub's green Code button opens, kept here so you do not have to go and find it.

HTTPS https://github.com/vonglurt/urfinkel.git
SSH git@github.com:vonglurt/urfinkel.git

Clone with either, then make && make disk. Or take a snapshot of main as an archive — these are GitHub's own, made from the branch on request, and are not the same files as the collections above: they are the whole repository, and they carry no checksums of their own.

Download ZIP https://github.com/vonglurt/urfinkel/archive/refs/heads/main.zip Download TAR.GZ https://github.com/vonglurt/urfinkel/archive/refs/heads/main.tar.gz

VIDEO

A demonstration of the game running on a Commodore Plus/4 — also on YouTube.

CONTROLS

KeyWhereWhat
15menuchoose a mode
17any turnchoose which piece to move
mmenu and promptscycle the music
smenuturn the sound effects on and off
spaceafter a win, rules screencontinue
returnname and colour promptsaccept what you typed — on its own, take what the game offers
delname and colour promptsrub out the last character
x x xany matchleave, and return to the cabinet

On a phone or a tablet, the same keys appear as buttons under the screen once the game is running — there is no other way to answer which piece? without a keyboard. The emulator's own on-screen pad is a joystick, and this game does not read one.

Left alone for two minutes, the cabinet starts the URBOT demo by itself and plays against itself.

WHAT THIS IS

The Royal Game of Ur, refereed by a Commodore Plus/4.

It is a race for seven pieces a side, it is about 4,600 years old, and it is a fun game. You do not need to read anything first — the machine holds the rules, casts the lots, and asks only which piece you want to move.

The ruleset is the one Irving Finkel reconstructed from a Babylonian tablet, which is where the program gets its name. If you want the detail, Wikipedia has it: the Royal Game of Ur and Irving Finkel. Otherwise press 5 on the menu for the rules screen, or just start.

HOW IT GOT HERE

The port is not the point, but it is why the game looks the way it does. This began as UR ROYAL, the same rules and the same screen written entirely in Commodore BASIC 3.5. That edition took 24 seconds to draw the board and 2.8 seconds to work out which moves are legal. Rewritten in C and 6502 assembly, the same work takes milliseconds — and the recovered time went straight back into the game: motion tweening, a real dice tumble, and music playing from a raster interrupt while the match runs. All three were ruled out before.

PrimitiveBASIC 3.5CompiledSpeedup
draw the board23 960 ms123.4 ms194×
paint one 4×4 square594 ms2.05 ms290×
refresh both token rows1 826 ms7.48 ms244×
find the legal moves2 785 ms4.83 ms577×

Measured on the machine, both editions against the same PAL jiffy clock. It has also been run on real restored hardware, loaded from an SD2IEC.

SCREENS

The title screen: a theatre proscenium with chasing lamps
The cabinet the game is played inside.
The board mid-match with the chronicle below
A match in progress.
CAPTURED in block letters over a bed of flame
A capture takes the bottom of the screen.
A gold trophy with the winner's name engraved in the bowl
The winner's name, poured into the cup.

THE PROJECT

Everything below points at the main branch on GitHub.

LICENCE

MIT License

Copyright (c) 2026 Paul Richeson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

The emulator on this page is EmulatorJS, which carries its own licence and is fetched from its CDN — only when you press play, and not before. It is not part of this project.