S39TRAPDOOR
The task
The squares table, swapped about. Swap it back.
For each X from 1 to 5, P must receive X times X.
h passes X to t and the answer on to P. t works it out.
The board
Key idea
Par is 7 swaps. Core h needs 1 operand swap; core t needs 2 instruction swaps and 4 operand swaps. 3 of them trade two tiles that hold each other's places; look for those first, since one swap mends both.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
JRX A jumps ahead A lines, and only the lines from there down count.
Hint 2Show
From the bottom up: ADD 20 alone turns 5 into 25.
Hint 3Show
A 4 lands on SUB 8, and 4 minus 8 plus 20 is 16.
Solution
Reveal the Full SolutionThe complete program for TRAPDOOR. 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.
hSC-2 standard
IN P0
OUT P1
IN P2
OUT P1tSC-1 lite
OUT 2
IN A
SUB 4
SUB 8
SUB 6
SUB 20
ADD P0
JRX P07 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
h, swap the operandP2on line 3 withP1on line 4. - In core
t, swap the operand2on line 1 withP0on line 7. - In core
t, swap the operand4on line 3 with2on line 7. - In core
t, swap the operand8on line 4 with4on line 7. - In core
t, swap the operand20on line 6 with8on line 7. - In core
t, swap the instructionOUTon line 1 withINon line 2. - In core
t, swap the instructionOUTon line 2 withJRXon line 8.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
hSC-2 standard
IN P0
OUT P1
IN P1
OUT P2tSC-1 lite
IN P0
JRX A
SUB 2
SUB 4
SUB 6
SUB 8
ADD 20
OUT P0- CYCLES
- 424
- at par
- ENERGY
- 1596
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 12
- at par
- SWAPS
- 7
- at par