Example

Time-travel game

Meet yourself in Portals

Place a portal, step back in time, and help your other self reach the star. Start with a single trip. Keep the same board and controls as meetings, lost moves, and doors enter the puzzle.

Play Portals Start with the guided lessons.
Portals: a numbered route, a forecast meeting marker, and a star beyond the portal.
  1. Place the portals.The opening lessons show how the recorded moves continue after a trip back in time.
  2. Meet your other self.A bump removes one move from each self. The first meeting includes a forecast so you can see what changes.
  3. Choose the timeline.When several timelines fit, you choose which one happens. Sometimes the only way in is the timeline where your future self comes back and bumps you through.
  4. Predict, then Run.Later lessons leave the timeline for you to work out. Show forecast and the staged hints remain available whenever you want help.
  5. Hold a door from the future.Combine meetings and pressure plates on the same screen. Review the replay one step at a time and adjust your plan.
  6. Order the loop.The last world deals you the moves as tiles. Swap them so the meeting takes the move you can spare.

Other ways to experiment

These versions use the same time-travel rules with different controls. You can stay in Portals for its whole sequence of lessons.

An engine and its configuration

Describe a puzzle using the shared game rules

Each level is a Bosatsu value that the shared rules consume.

Puzzle configuration / Bosatsu

A board, portals, and a recording

Each level supplies values to the same puzzle type.

Puzzle value ↓

Reusable rules / Bosatsu

Movement, collisions, and timeline replay

The same rules consume each level’s configuration.

Compiled game and UI ↓

Yichus browser runtime / JavaScript

Controls, state updates, and display

The host executes the generated program.

The game demonstrates an engine/configuration boundary. Its replay follows the game’s rules; it is separate from the API and distributed-system checkers.

The original recording editor’s tutorial board configuration:

grid_0 = empty_grid(10, 6)
grid_1 = set_cell(grid_0, 1, 4, Start)
grid_2 = set_cell(grid_1, 4, 4, PortalIn)
grid_3 = set_cell(grid_2, 1, 3, PortalOut)
grid_4 = set_cell(grid_3, 5, 3, Goal)
Puzzle configuration & engine source Read the files, then run the shipped game

Read the complete game source.

Back to Yichus · Try a simulation with Why explanations

Ask your agent about anything here; it has the detail.

Where this fits

What this is about: Why an Analyzable Language?