S27COMEDOWN
The task
The landing program, swapped about. Swap it back.
P0 is a PWM pin into R1 and C1, and P1 ticks every 40 cycles.
Step CH1 down: full, three quarters, half, a quarter, and off, then full again.
The board
- Resistors
- R1 1 kΩ
- Capacitors
- C1 1 µF
- Probes
- CH1
Key idea
Par is 5 swaps. Core u1 needs 3 instruction swaps and 2 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
B keeps the duty across the sleep on P1. MOV A, B brings it back.
Hint 2Show
SUB 25 drops one step. At 0 the next duty is 100, not a negative step.
Hint 3Show
JZ takes the reset and JMP skips it, so both paths meet at MOV B, A.
Solution
Reveal the Full SolutionThe complete program for COMEDOWN. 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
MOV A, B
IN 100
OUT A
SUB 25
JZ K
F: MOV F, P0
K: MOV B, A
JMP P15 swaps back
Make these swaps in order. Lines are numbered from 1 in each core.
- In core
u1, swap the operand100on line 2 withP0on line 6. - In core
u1, swap the operandAon line 3 withFon line 6. - In core
u1, swap the instructionINon line 2 withOUTon line 3. - In core
u1, swap the instructionINon line 3 withJZon line 5. - In core
u1, swap the instructionINon line 5 withJMPon line 8.
The finished program
Every tile back in place: the reference solution, which scores exactly par on every benchmark.
u1SC-2 standard
MOV A, B
OUT P0
JZ F
SUB 25
JMP K
F: MOV A, 100
K: MOV B, A
IN P1- CYCLES
- 68
- at par
- ENERGY
- 136
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 8
- at par
- SWAPS
- 5
- at par