50ACKNOWLEDGE
The task
P must receive a copy of X. The line from tx to rx is locked and loses values.
Every third value it carries comes out as a 0, starting with the first. X is from 1 to 99.
The board
Key idea
A locked lossy line turns every third value into a 0; the receiver acks and the sender resends.
Hints
Each hint goes a step further than the one before. Open them one at a time.
Hint 1Show
rx can tell a lost value because X is never 0.
Hint 2Show
Have rx answer tx after every value, so tx knows whether to send it again.
Hint 3Show
tx must keep the value in B until rx says it arrived.
Solution
Reveal the Full SolutionThe complete program for ACKNOWLEDGE. 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.
txSC-2 standard
IN P0
MOV B, A
R: MOV A, B
OUT P1
IN P2
JZ RrxSC-2 standard
S: IN P0
OUT P2
JZ S
OUT P1- CYCLES
- 809
- at par
- ENERGY
- 3180
- at par
- NODES
- 2
- at par
- INSTRUCTIONS
- 10
- at par