Syscall 2: Firmware, home

SignalChapter 8: Scarcity

62SQUARES

The task

For each X from 1 to 5, P must receive X times X.

h is a standard core cut to 4 lines. t is an SC-1 on a two way wire: register A only, 8 lines.

The board

The board of SQUARES2 cores: h and t. Inputs X; outputs P.hSC-2 4 LINEStSC-1 8 LINESP0P1P2P0XP
The board as the puzzle screen lays it out. Cyan pins read, lemon pins write, violet pins go both ways. On a narrow screen, scroll the board sideways to see all of it.

Key idea

JRX into a run of ADDs and SUBs is a lookup table that fits an SC-1.

Hints

Each hint goes a step further than the one before. Open them one at a time.

Hint 1Show

JRX A can land inside a run of ADDs and SUBs, and then only the lines from there down count.

Hint 2Show

Work out the run from the bottom up: the last ADD alone must turn 5 into 25.

Hint 3Show

h has just enough lines to pass X to t and the answer on to P.

Solution

Reveal the Full SolutionThe complete program for SQUARES. Open it only when you want the answer.

The reference program

The game's own solution. It passes every test and scores exactly par on every benchmark.

hSC-2 standard

IN P0
OUT P1
IN P1
OUT P2

tSC-1 lite

IN P0
JRX A
SUB 2
SUB 4
SUB 6
SUB 8
ADD 20
OUT P0
CYCLES
440
at par
ENERGY
1643
at par
NODES
2
at par
INSTRUCTIONS
12
at par