CURIOUSMONKEY / LABCODE OBSERVATORY

SMALL INSTRUCTIONS. BIG IDEAS.

See what code does.

A program is a set of instructions. Take one step, see what changes, and work out why. No coding experience needed.

Start exploring ↘
Pick a code templateEvery template is editable. Follow what happens, one instruction at a time.25 templates +

YOUR CODE WORKBENCH

The running total

PREDICT THE RESULT

Start

Step or play to build a trace. Drag here to revisit the steps you have seen.

The instructions

MINISCRIPT

Orange = just executed. The arrow marks what runs next. Tap a line number to pause before that line. Hover or tap a symbol to learn its meaning; ? explains the whole line.

Next: line 1No pause points

What the program says

0 messages

    A print instruction puts a message here.

    Inside the program

    Charts ↓
    READY TO EXPLORE

    Start with one instruction.

    Take the first step and see a value appear in memory.

    Why did that happen?

    Executed instructions0
    Active + waiting calls1
    Named values in memory0
    Program stateReady

    Ready. Take the first step.

    YOUR TURN TO THINK

    What happens next?

    Pause before each instruction and make a guess. You can always skip and watch.

    Give me a hint

    CHANGE ONE THING

    Make it your experiment.

    FOLLOW THE EVIDENCE

    The shape of a run.

    These counts describe your program, not computer speed. The chart includes every visited step; the orange marker is the step you are viewing.

    Read the trace as a table
    Most recent 120 visited instructions. Export CSV for the full visited trace.
    StepLineFunctionWhat happened

    THE LANGUAGE

    Small enough to understand.

    MiniScript supports values, arrays, arithmetic, conditions, loops and named functions. It runs in a bounded interpreter with no access to files, websites or browser commands.

    Open the syntax guide
    let total = 0
    let items = [2, 4, 6]
    total = total + items[0]
    print total
    if total > 0 {
      print "positive"
    }
    else {
      print "zero"
    }
    while total < 3 {
      total = total + 1
    }
    fn double(n) {
      return n * 2
    }
    let answer = double(4)
    print answer
    # A full-line comment

    Closing braces belong on separate lines. Arrays start at index 0 and cannot be edited in place. Use len(items) for their length. Assign a function call on its own line; nested user calls inside expressions are unsupported. let declares a name once in the current function frame; assignment changes it.

    Operators: + − * / % == != < <= > >= && || !. Code uses the ordinary keyboard minus sign -.

    HOW TO READ IT

    A value. A choice. A change.

    A variable is a name holding a value. An array is an ordered list with numbered positions. A function has its own local names; its caller waits until it returns.

    One step is an assignment, test, print, call, return, internal jump or completion. A loop line can appear more than once: first the jump returns to it, then the condition is checked again.

    Back restores memory, output and calls together. The timeline covers the visited trace; rewind keeps up to 500 snapshots within a 2-million-character buffer. Restart returns to the beginning.

    ROOM TO EXPERIMENT

    Useful boundaries.

    Programs stop after 3,000 instructions or 64 call frames. Code is limited to 20,000 characters / 400 lines, arrays to 256 items, and strings to 10,000 characters. Numbers stay within ±10¹⁵. Expressions, blocks and nested arrays have a 64-level limit; execution state is capped at 200,000 characters.

    Save program keeps the code, pace and pause points on this device. Load saved starts that code at the beginning. Comparisons stay separate. Download code for a portable copy.

    Research, model limits & verification ↗