51TIMES TABLE
The task
P must receive X times Y. There is no instruction that multiplies.
X is never 0 and Y is from 0 to 9.
The board
Key idea
Multiply by adding: one core sends X round Y times and a 0, another adds them up.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
Multiplying is adding X to itself Y times.
Hint 2Show
k can send X round once for each step of Y and then a 0 to end the frame.
Hint 3Show
s adds up a frame the way h did in ROUND TRIP.
Solution
Reveal the Full SolutionThe complete program for TIMES TABLE. 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.
mSC-2 standard
IN P0
OUT P3
IN P1
OUT P3
IN P4
OUT P2kSC-2 standard
IN P0
MOV B, A
IN P0
L: JZ DN
SUB 1
XCH A, B
OUT P1
XCH A, B
JMP L
DN: OUT P1sSC-2 standard
S: IN P0
JZ E
ADD B
MOV B, A
JMP S
E: XCH A, B
OUT P1- CYCLES
- 587
- at par
- ENERGY
- 4600
- at par
- NODES
- 3
- at par
- INSTRUCTIONS
- 23
- at par