S43STILL LIFE
The task
The sample and hold, swapped about. Swap it back.
On each rising edge of the clock on P1, sample P0.
Hold the sample on P2 until the next edge.
The board
- Sources
- V1 2.5 V, V2 2 V sine at 25 Hz, and V3 5 V square at 125 Hz
- Resistors
- R1 1 kΩ
- Capacitors
- C1 1 µF
- Probes
- CH1, CH2, and CH3
Key idea
Par is 6 swaps. Core u1 needs 3 instruction swaps and 3 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
A rising edge is a 1 read after a 0: wait for the high, then for the low.
Hint 2Show
JZ loops while the clock is low, and JNZ loops while it is high.
Hint 3Show
Read P0 once, right after the edge, and write it to P2 as it is.
Solution
Reveal the Full SolutionThe complete program for STILL LIFE. 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.
u1SC-2 standard
L: JZ H
IN L
JNZ P1
IN P0
H: IN P1
OUT P26 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
u1, swap the operandHon line 1 withP1on line 3. - In core
u1, swap the operandHon line 3 withP0on line 4. - In core
u1, swap the operandHon line 4 withP2on line 6. - In core
u1, swap the instructionJZon line 1 withINon line 2. - In core
u1, swap the instructionJNZon line 3 withINon line 4. - In core
u1, swap the instructionJNZon line 4 withOUTon line 6.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
u1SC-2 standard
L: IN P1
JZ L
IN P0
OUT P2
H: IN P1
JNZ H- CYCLES
- 800
- at par
- ENERGY
- 1600
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 6
- at par
- SWAPS
- 6
- at par