B37ONE SHOT
The task
V1 drives P0 with a slow square wave. On each rising edge, light the LED on P1 for 30 cycles.
Then put it out and wait for the next rising edge. Every instruction takes one cycle.
The board
- Sources
- V1 5 V square at 50 Hz
- Resistors
- R1 330 Ω
- LEDs
- D1 yellow
- Probes
- CH1 and CH2
Key idea
A rising edge is a 1 read after a 0: wait while P0 reads 1, then wait while it reads 0.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A countdown loop of SUB 1 and JNZ spends two cycles a pass.
Hint 2Show
MOV A, 14 before the loop gives 28 cycles, and the lines around it make up the rest.
Solution
Reveal the Full SolutionThe complete program for ONE SHOT. Open it only when you want the answer.
The reference program
The game's own solution. It passes every test and scores exactly par on every benchmark.
30 cycles of light after each rising edge.
u1SC-2 standard
L: IN P0
JNZ L
H: IN P0
JZ H
MOV A, 1
OUT P1
MOV A, 14
W: SUB 1
JNZ W
OUT P1- CYCLES
- 800
- at par
- ENERGY
- 1600
- at par
- NODES
- 1
- at par
- INSTRUCTIONS
- 10
- at par