Skip to content
ByteStepStart with recursion

Interactive computer science · Free · No account

You have read how it works.Now watch it run.

You can define recursion and still not picture what the machine is doing. That gap is not a gap in you. It is what a still diagram leaves out.

So here it is moving. Step through it with your own numbers.

8 minutes · Works on your phone · Nothing to install

Recursion · fib(4)

step 1/24

4
  1. fib(4)
    n = 4

1 frame

We start with fib(4). Nothing has been worked out yet. It is a question waiting for an answer.

How a ByteStep lesson works

Four things happen in every lesson, in this order. None of them involve watching passively.

  1. 01

    Watch it run

    The lesson starts moving the moment it loads. Nothing to read first, nothing to press.

  2. 02

    Take it apart

    Scrub to any step, go backwards, slow it down. The picture is drawn from the state at that exact moment, so stepping back is real, not a rewind.

  3. 03

    Predict what happens

    Three questions in every lesson, waiting where you came to be asked rather than interrupting the animation. You commit before you see the answer.

  4. 04

    Change the numbers

    Set your own input and the whole simulation re-runs. It is your example now, not ours.

Why watching beats reading

The animation cannot lie

Each lesson is a small program that genuinely runs the mechanism and records every state. The picture is drawn from those states, so the numbers on screen are the real ones, and every lesson ships with tests proving it.

It bridges back to your notes

Intuition you cannot connect back to the standard material is entertainment. Every lesson names the concept the way the textbooks do, and shows the conventional notation beside the animation.

Three depths, one page

Read the intuition in ninety seconds, or open the mechanism, or go down to the hardware detail and real numbers. Same page, one toggle, so it is still worth opening on the second visit.

Named after the modules a computer science degree actually teaches, and anchored to the textbooks those courses are built from, so this works whether you are taking one, catching up on one, or filling a gap you never covered.

Start where everybody gets stuck

Recursion, with the call tree and the call stack side by side. Eight minutes, and you can change the numbers.

Open the lesson

Questions first? Read the FAQ.