S03JUMBLE
The task
The pieces are all here. Swap them until the program runs.
Only values greater than 0 may reach P. Drop zero and every negative value.
The board
Key idea
Par is 3 swaps. Core c0 needs 2 instruction swaps and 1 operand swap. 2 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
A jump takes a label, as in JG H. A label never goes where a pin belongs.
Hint 2Show
JG jumps when A is greater than 0. JMP always jumps.
Hint 3Show
If the value is not positive, jump back to the read before writing.
Solution
Reveal the Full SolutionThe complete program for JUMBLE. 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.
c0SC-2 standard
S: OUT P0
IN S
JMP H
H: JG P1c1SC-2 standard
IN P0
OUT P13 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
c0, swap the operandSon line 2 withHon line 3. - In core
c0, swap the instructionOUTon line 1 withINon line 2. - In core
c0, swap the instructionOUTon line 2 withJGon line 4.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
c0SC-2 standard
S: IN P0
JG H
JMP S
H: OUT P1c1SC-2 standard
IN P0
OUT P1- CYCLES
- 137
- at par
- ENERGY
- 852
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 6
- at par
- SWAPS
- 3
- at par