MJ
MIDNIGHT JUNCTIONTHE ARCHIPELAGO RAILWAY COMPANY
All work saved
Connecting to the control tower…
CONTRACT 01 / BEACON ISLE

A light in the rain

00:00SIMULATION CLOCK
Light rain · tide rising
● Waiting● In transit● Restored
CARGO DELIVERED0 units
MAXIMUM DELAY0 ticks
CONFLICTS0
ENERGY USED0 kWh
TONIGHT’S OBJECTIVE

Departure board

No reservations
TRAINCARGO / DESTINATIONSTATUSDEADLINE
TOWER A / DISPATCH PROGRAM
Oracle PL/SQL
TRANSACTIONNo uncommitted departures

Signal log

Open the stage guide, fill in the template, then run your program.

Try your own program first. Reveal one tip at a time when you need help.

    RAILWAY EVENTS

    Waiting for the first departure.

    How to play

    Fill in the unfinished template with your own commands, then run it. COMMIT releases a reservation to the railway. Watch after Run starts the clock automatically for new committed departures. Turn it off to use Play or Step +1 manually. If a train already has a reservation, choose Watch trains instead of dispatching it again. Editing code alone never moves a train.

    The control desk

    SQL queries run in Oracle. An id or train_id column highlights matching trains on the map. Run one SQL statement, anonymous block, or package definition at a time. / on its own final line is optional.

    Run does not automatically commit. Oracle DDL, such as CREATE PACKAGE, does implicitly commit. Rollback cancels only uncommitted proposals; it never moves time backward.

    Campaign & records

    Discovery mode opens districts in order. All language syntax works from the start. Expert mode opens every contract for practice and preserves your records. Retrying restores the same tide and keeps code, discoveries, and best schedules.

    Gold requires every delivery with zero delay and zero conflicts. Records prefer fewer conflicts, then lower maximum delay, then energy, then ticks. Equipment stays identical for each contract. Translucent trains show your best timetable.

    Runtime

    Programs execute in a private cloud Oracle database, in a restricted game schema. Calls are bounded and Stop cancels execution. Each visit reserves the railway for about 20 minutes. Your campaign is saved for this browser. End your session when you finish so another dispatcher can play. No replacement PL/SQL interpreter is used.

    Railway API

    junction.dispatch(train_id, route_id, tick?)
    Reserve one train. Without a tick, choose the next free slot on that track.
    junction.reserve_next(route_id)
    Reserve the next waiting train for the route’s destination. Useful for numeric loops.
    junction.prepare(train_id)
    Prepare a quiet carriage for delicate cargo before proposing its departure.
    trains
    id, destination, cargo, value, deadline, delicate, status, route_id, arrival. Read-only simulation state.
    routes
    id, destination, name, duration, energy, flooded. A flooded value of 1 means closed.
    stations · clock_state
    Station id and name. Current simulation tick.
    proposals
    Insert train_id, route_id, depart_tick. Oracle computes platform and arrival_tick. Unique constraints protect train and platform reservations.

    Schedule departures at least duration ticks apart on one track. The engine rejects overlapping journeys even if departure ticks differ. Delays are measured at delivery. Waiting without running the clock costs nothing.

    Full stage solutions unlock after three tips. Your stage guide lists commands and syntax without filling in the answer.

    Compare this with your approach. Loading it replaces the editor; it does not reset the railway.