6FLOOR
The task
Only values greater than 0 may reach P. Drop zero and every negative value.
P will be shorter than X.
The board
Key idea
Labels, JG, JMP, dropping values.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
A label names a line, as in S: IN P0. A jump goes there, as in JMP S.
Hint 2Show
JG jumps when A is greater than 0, JL when it is less. 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 FLOOR. 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.
c0SC-2 standard
S: IN P0
JG H
JMP S
H: OUT P1c1SC-2 standard
IN P0
OUT P1- CYCLES
- 146
- at par
- ENERGY
- 954
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 6
- at par