Syscall 2: Firmware, home

SignalChapter 9: Special nodes

72POLYNOMIAL

The task

X sends three numbers, a, b, and c, once at the start of each test.

For each Y, P must receive a times Y squared, plus b times Y, plus c.

cf is an SC-4, with registers C and D; ev is an SC-2D, where jumps take 3 cycles.

The board

The board of POLYNOMIAL2 cores: cf and ev. Inputs X and Y; outputs P.cfSC-4 15 LINESevSC-2D 10 LINESP0P1P2P0P1XPY
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

A setup phase: X sends a, b, and c once per test, so they are read before a loop that never goes back; then two rounds of ask and answer per point.

Hints

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

Hint 1Show

X sends a, b, and c only once, so read them before the loop and never jump back there.

Hint 2Show

cf can hold a, b, and c, but then it has no room for Y. ev can keep Y in B.

Hint 3Show

a times Y plus b, times Y again, plus c, gives the same answer.

Solution

Reveal the Full SolutionThe complete program for POLYNOMIAL. 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.

cfSC-4 quad

IN P0
MOV B, A
IN P0
MOV C, A
IN P0
MOV D, A
L: IN P1
MUL B
ADD C
OUT P1
IN P1
ADD D
OUT P2
JMP L

evSC-2D signal processor

IN P0
OUT P1
MOV B, A
IN P1
MUL B
OUT P1
CYCLES
474
at par
ENERGY
4257
at par
NODES
2
at par
INSTRUCTIONS
20
at par