Syscall 2: Firmware, home

ShuffleChapter 2: Workshop

S01CROSSED WIRES

The task

The code that solves this is all here, in the wrong places. Swap the pieces back.

Every value from X must reach P raised by 25.

The board

The board of CROSSED WIRES2 cores: a and b. Inputs X; outputs P.aSC-2 15 LINESbSC-2 15 LINESP0P1P0P1XP
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

Par is 2 swaps. Core a needs 1 instruction swap and 1 operand swap. Every one of them trades two tiles that hold each other's places, so each swap mends two.

Hints

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

Hint 1Show

Instructions swap with instructions and operands with operands, inside one core.

Hint 2Show

IN replaces A and OUT sends A as it is, so the ADD goes after the IN and before the OUT.

Hint 3Show

Core b only passes values along: IN P0, then OUT P1.

Solution

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

The board as dealt

This is the arrangement the game deals. Framed tiles are the ones out of place.

aSC-2 standard

IN P0
OUT P1
ADD 25

bSC-2 standard

IN P0
OUT P1

2 swaps back

Make these swaps in order. Lines are numbered from 1 in each core.

  1. In core a, swap the operand P1 on line 2 with 25 on line 3.
  2. In core a, swap the instruction OUT on line 2 with ADD on line 3.

The finished program

Every tile back in place: the reference solution, which scores exactly par on every benchmark.

aSC-2 standard

IN P0
ADD 25
OUT P1

bSC-2 standard

IN P0
OUT P1
CYCLES
159
at par
ENERGY
1170
at par
NODES
2
at par
INSTRUCTIONS
5
at par
SWAPS
2
at par