S46LOST TIME
The task
The clock code, swapped about. Swap it back.
X is a time in minutes, from 0 to 240.
P must receive the whole hours in it, and Q the minutes left over.
The board
Key idea
Par is 8 swaps. Core a needs 2 instruction swaps and 1 operand swap; core b needs 2 instruction swaps and 3 operand swaps. 4 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
DIV 60 gives the whole hours. MOD 60 keeps the minutes left over.
Hint 2Show
a sends X on to b before it divides, then sends the hours after it.
Hint 3Show
b reads twice: X for the minutes, then the hours to pass along.
Solution
Reveal the Full SolutionThe complete program for LOST TIME. 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-1 lite
OUT P1
OUT P1
IN 60
DIV P0bSC-2 standard
IN 60
OUT P1
IN P0
MOD P0
OUT P28 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
a, swap the operandP1on line 1 withP0on line 4. - In core
a, swap the instructionOUTon line 1 withINon line 3. - In core
a, swap the instructionOUTon line 3 withDIVon line 4. - In core
b, swap the operand60on line 1 withP0on line 3. - In core
b, swap the operandP1on line 2 with60on line 3. - In core
b, swap the operandP1on line 3 withP2on line 5. - In core
b, swap the instructionOUTon line 2 withMODon line 4. - In core
b, swap the instructionINon line 3 withOUTon line 4.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
aSC-1 lite
IN P0
OUT P1
DIV 60
OUT P1bSC-2 standard
IN P0
MOD 60
OUT P2
IN P0
OUT P1- CYCLES
- 354
- at par
- ENERGY
- 1638
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 9
- at par
- SWAPS
- 8
- at par