DEV Community

Aditya Rasal
Aditya Rasal

Posted on

Solstice Machine — a Turing machine whose tape is a day

June Solstice Game Jam Submission

This is a submission for the June Solstice Game Jam

What I Built

Solstice Machine is a browser puzzle game where you program a tiny two-state
Turing machine — except the tape is a day. The "tape" is a ring of 24 hours,
each one light (gold, a sun tick) or dark (deep blue, a crescent). A
little orb walks the ring — a sun in state A, a moon in state B — reading
each hour and following the rules you build, lighting and darkening the day.

Each level is a calendar day. You transform the starting day into a target day
within a step budget, and the campaign marches from the spring equinox to
June 21
— daylight literally growing level by level until the finale asks you
to construct the longest day of the year. That's the jam's solstice theme baked
straight into the progression.

Every day you solve decodes one word of a hidden message. After the tenth:

FOR ALAN, WHO IMAGINED US — RUN PROUDLY AS YOURSELF.

The completed solstice ring blooms a soft rainbow around its rim. June holds the
solstice, Pride, Juneteenth's light of freedom, and Alan Turing's birthday
the game is one small image that tries to hold all four. It's an original tribute
to Turing: you're programming his machine, one level is his wartime
codebreaking, and the message and the rainbow are his life, honored.

▶️ Play it now (no install, runs in your browser):
https://aditya2073.github.io/solstice-machine/

Title screen

Video Demo

Solstice Machine — watch the 68-second trailer

▶️ Watch the 68-second trailer — it's also set as this post's cover video, so it plays right at the top. Every machine you see run is not a screen capture: I extracted the game's real Turing-machine simulator and rebuilt the ring, head, sky, and rainbow as components driven by the actual simulate() trace, with a from-scratch synthesized score. (Made with Remotion.)

Code

GitHub logo Aditya2073 / solstice-machine

A small machine for long days — a single-file browser puzzle game where you program a Turing machine on a 24-hour ring. DEV June Solstice Game Jam. For Alan Turing.

SOLSTICE MACHINE

A small machine for long days.

A browser puzzle game for the DEV June Solstice Game Jam. You program a tiny Turing machine whose tape is a day — a ring of 24 hours, each light or dark Ten days carry you from the spring equinox to June 21, and every solved day decodes one word of a hidden message.

An original tribute to Alan Turing — born in June, father of the machine you are programming, persecuted for being gay. The final day blooms a rainbow.


How to play

The day. The ring is one day: 24 hours, each light (gold, sun tick) or dark (deep blue, crescent). NOON is at the top, MIDNIGHT at the bottom. The faint inner ring is the target day you must create.

The head. The orb traveling the ring is the machine's head — a sun in state A

It's a single index.html — ~250 KB, more than half of which is three
embedded subset typefaces. No build step, no frameworks, no network requests.
Double-click the file and it runs.

The whole simulator is a pure function, simulate(tape, head, rules, budget),
completely separate from rendering — the UI never executes rules itself, it just
replays the simulator's trace with animation, so what you watch is exactly what
gets verified
. Open index.html?dev=1 and the console prints a table proving
all ten levels are solvable by their stored intended solutions, within budget, at
the 3-sun threshold — and that no level is cheesable with an empty rule set.

How I Built It

The machine is a real Turing machine, just small and warm:

  • Tape: 24 cells in a circle — it wraps, so clockwise past hour 23 is hour 0.
  • Head: starts on a level-defined hour in state A. Two states total, drawn as sun (A) and moon (B).
  • Rules: there are only four conditions (2 cell values × 2 states). Each rule writes a value, turns one hour CW/CCW, and becomes a state — or HALTs.
  • Ends: the machine halts, stalls (no rule covers what it reads — empty slots are deliberate stop signs!), or the budget runs out. Then the day is compared to the target.

The hardest problem was termination. A two-state machine walking over cells it
has to cover with rules cannot stop by stalling — I kept designing levels that
were provably unsolvable runaway loops. The fixes became the curriculum itself:
paint toward the light so you stall on it, leave a slot empty as a stop sign,
spend a state to remember you're done, HALT explicitly, use parity to detect "two
lights in a row," and finally let the budget itself be the clock. The JUN 21
finale is the thesis stated as a mechanic: the world is handed to you backwards —
light huddled around midnight — and the intended machine is two rules (light
becomes dark, dark becomes light, always turn toward evening
) with a budget of
exactly 24 steps. The head sweeps once around the whole day like the sun
completing its circuit, every hour blooming as it passes, and the run ends
precisely as the day comes right. Run proudly as yourself.

A few decisions I'm happy with:

  • The sky is the system. The page background is four designed gradients crossfaded by the tape's light ratio — every write nudges the sky, so solving a level literally feels like sunrise.
  • DOM, not canvas. 24 cells + ticks + head is trivial for the DOM, the glow is plain CSS, and every cell carries a real ARIA label.
  • Shape coding everywhere. Light cells get a sun tick, dark cells a crescent; states are A/B chips, never color alone — colorblind players play the same game. Honors prefers-reduced-motion.
  • Sound from nothing. Every sound is synthesized live with WebAudio — a tick per step, a bloom for lighting a cell, a morph gliss for sun↔moon, a chord swell under the victory bloom. No audio files, lazy-initialized so there are no autoplay warnings.
  • Design as law. The visual system came from a full design pass (tokens, nine mockups, motion spec, copy deck) — Solstice Night indigo, Gnomon Brass, Moonsilver; Marcellus for engraving, IBM Plex Mono for the cipher voice. All 34 design tokens are lifted verbatim and checked by a script.

Prize Category

Best Ode to Alan Turing. The machine you program is his machine. One level
is his wartime codebreaking — the target ring is shown as intercepted, inverted
and shifted, and you decode it. The hidden message is a dedication to him, the
finale is a world that has light and dark backwards being set right by running
truthfully, and the reward is the rainbow. The whole game is built so that
finishing it is the ode.


Built solo for the DEV June Solstice Game Jam. One HTML file · no engine · for Alan.

Top comments (0)