Sema-tawy

Sema-tawy is a mahjong journey through ancient Egypt, with the amulets of Amulets of Anubis. Its name is the sema-tawy, the union of the Two Lands: the lotus of the south and the papyrus of the north tied together, two made one, as every pair is. Take pairs of matching amulets off a stack shaped like a pyramid, a temple, a cat, the sun or Giza’s three pyramids, until the table is clear. An amulet can be taken when nothing lies on top of it and it has nothing beside it on at least one side.
Play a single stack whenever you like, try the stack of the day, or set out on a journey up the Nile through three seasons, with markets, shrines, tombs, oases and the river in between, boons to use, relics to keep and omens to brave.
The whole game is a single HTML file. There is nothing to install and no account to make. It never goes online: no ads, no tracking and no update that changes it behind your back. Open the file in a browser and it works, and it should still work in twenty years. There is an Android app too, and programs for Windows, macOS and Linux.
We also wanted it to be easy to change. The stacks, the boons and relics, the river’s stories, every word on screen, every number and every picture are small text files that explain themselves. You can make your own version without writing any code.
Look something up
Every field of every content file and every name the build knows.
Build the app
The Android app and the desktop programs, from this one folder.
Work on the code
The manual, part 2: how the engine works inside and how to extend it.
What’s in it
- Fifty-seven stacks, from the pyramid and the temple to the butterfly, the cat, the sphinx, the sailing boat, Apep’s coil, Abu Simbel, the labyrinth and the lighthouse of Alexandria, the deepest six layers high. Each has its own music and a shape for a phone held upright. Most are found on a journey before free play offers them.
- A journey up the Nile in three seasons, Akhet, Peret and Shemu, from Alexandria to Abu Simbel. Each season is eight rows: four of stacks, two of stops between them, an oasis and the season’s great stack. Markets sell boons and relics for deben, shrines give a boon, tombs hold a hard stack with an omen and a relic, oases give a shuffle back and a small stack by the water, and on the river something always happens. The stacks grow deeper and harder as you climb. Stuck with no shuffle left, a stack costs a life.
- Four levels: Relaxed, Normal, Hard and Pharaoh. The first rows of a journey are gentle. The last two amulets are dealt again when you’re stuck with them and once a journey the Gods will deal a stack again. A phone and a computer deal a little differently, so a journey is about as hard on both (how hard, and why).
- The stack of the day, the same for everyone, with no shuffle: stuck, try it again, and the stamp says at which try you cleared it.
- Free play, one stack at a time, with nothing to lose.
- Special amulets on a journey: gold ones worth more, veiled ones that show only their backs, sealed ones, covered ones (under alabaster, glass, beads, amber, sand, bandages, water or vines), rubble that crumbles, turquoise pairs and the Four Sons of Horus, any two of whom make a pair.
- Help for a new player: a tutorial the first time, tips in the first journeys, a nudge that says why an amulet can’t be taken, a hint that says why, an undo on Relaxed and in free play and, when a stack is lost, the pair after which it could no longer be cleared.
- What comes home: from a journey won, its score (the deben left at the end, the best kept for each level) and the relics it carried, each opening a look of its own; the stacks found and the days cleared. All of it is shown in a museum. Turquoise, a rare money from journeys won, the stack of the day, turquoise pairs and deeds, buys new looks in Customise.
- Fifteen tile looks with real thickness (bone and lapis, faience, sandstone, gold leaf, ebony, ebony and ivory, Djoser’s tiles, papyrus and lapis cards, and six to buy), nine sets of amulets (one comes with Djoser’s tiles, four are bought with turquoise), three page styles, thirteen tables and the scenery of the Nile behind every stack.
- Music made as it plays, in each stack’s own key and in Arabic and Gypsy scales (the maqamat Hijaz, Bayati, Rast, Saba and others, some with quarter tones): songs with a tune that comes back, led by a soft qanun with the ney, a handpan, the marimba and the harp taking turns over gentle hand drums, or the calm music of the Nile. Gentle sounds in the same key; a small buzz for a tap in the Android app.
- How to play in seven chapters, in the game and on the website. High contrast, less motion and a loudness slider each for the sounds and the music in Settings.
There are more pictures on the screenshots page.
Playing it
Build it once (see below), then open dist/sema-tawy.html in a browser. That one file is the entire game, so you can copy it anywhere and keep it.
Note: Your progress is saved in the browser you play in. A journey is kept when you close the page and picked up where you left it.
Building it
All you need is Python 3, and Node.js so the build can check that every stack can be cleared.
python3 build.py # or double-click build.bat on Windows
The build checks every content file before it writes anything. If something is wrong, it tells you which file and which line in plain words and leaves your last working game alone. Otherwise it writes dist/sema-tawy.html.
A few other commands come in handy while you work:
| Command | What it does |
|---|---|
python3 build.py --check | checks the content without writing anything |
python3 build.py --watch | builds again every time you save a file |
python3 build.py --debug | also writes dist/sema-tawy-debug.html, which keeps a play log on the device (saved as a file from its menu, sent nowhere) |
python3 engine/tools/new.py | starts a new stack, boon, relic, omen, river event or tile look from a ready-made file (tools/new.bat on Windows) |
dist/sema-tawy.html?try | opens the game in try-out mode, with its own save and every stack open; ?try&layout=cat goes straight to a stack, ?try&run to a journey |
python3 engine/tools/build-android.py builds the Android app and python3 engine/tools/build-desktop.py the desktop programs. The build guide says what they need.
Making it your own
Most of the game is content rather than code:
| To change | Edit |
|---|---|
| the stacks | one small file each in content/layouts/ (or draw them in tools/draw-layouts.py) |
| boons, relics, omens, places on the map, river events | one small file each in content/ |
| how hard it is: the levels, the map, the money, the help | content/settings.jsonc |
| tile looks, picture sets, page styles, tables | a file in content/ and a stylesheet in web/ |
| the words on every screen, How to play, the tutorial, the sounds and effects | edition.jsonc |
| every picture | files in images/ (SVG, see images/README.md) |
If you have never programmed, start with the first part of the manual. It walks you through changing words, pictures and numbers and adding a new stack and a new boon.
How it is made
The game is built on Plinth, an engine for games of taking pairs off a stack that knows nothing of Egypt, with the sound and the music. Plinth has a repository of its own; the game keeps a copy in engine/. The rules run without a browser, so a bot can play them: node engine/tools/sim.js plays every stack, node engine/tools/run-sim.js whole journeys and node engine/tools/difficulty.js measures every level. The second part of the manual and the code map explain the rest.
Documentation
| The manual | in two parts: making things (for everyone) and the engine (for programmers) |
| How hard it is | what makes a journey hard, what we measured and what moves it, on a phone and on a computer |
| Reading the code | a gentle way into the code, for a first reader |
| Content reference | every field of every kind of content file |
| A map of the code | what each file of the engine is for and what’s in it |
| Build guide | the Android app and the desktop programs |
| Screenshots | pictures of the game |
| AGENTS.md | the rules for contributors and AI agents |
| PLAN.md | what comes next |
| Decisions | every decision made along the way, newest last |
Where things are
| Folder | What is in it |
|---|---|
content/ | everything a player sees or reads that isn’t a rule, one small file each, and the settings |
images/ | the pictures (amulets, cards, covers, tables, scenery) and where they came from |
web/ | the game’s stylesheets: its skin, tile looks, page styles, tables, scenery, cards |
engine/ | Plinth: the rules, the page, the build and the tools that test them |
platforms/ | the Android app and the desktop programs |
tools/ | helpers: the drawing scripts, update-plinth.py, the docs’ pictures, the website |
docs/ | the manual, the build guide, the screenshots and the history of every decision |
dist/ | what the build makes (not kept in git) |
Private. Its one remote is on the owner’s own server.