Skip to main content

Week 2 Tutorial: One headless run

Get the specimen running on your own machine with no window open, and time it.

4 March 2027

Before the tutorial

Clone the specimen and install its dependencies. Bring a laptop that can run Node.

In the tutorial

Call the headless runner once with seed 97 and an ordinary simulated player. Write down three things: how long it took, whether the run was won or lost, and the second it ended on. For reference, a 2024 laptop takes about 10 ms on the first call and under 4 ms once warm, and the run is lost at 69.333 s.

Then run the same seed again. If the two results differ in any digit, something in your setup is reading a clock or a random number it was not handed, and finding it is the rest of your tutorial.

Where it goes wrong

What a finished answer looks like

Seed 97, 150 ms player: lost at 69.333 s. Fifth call took 3.7 ms. Run twice, identical to the millisecond.

Afterwards

The timing is your number for this week’s quiz. Multiply it out: how many runs could you do in the 120 s it takes a person to play one?

The spec

What you walk out with. Every line is something the person sitting next to you could check.

Teaching team