YPetremann / ShenzhenIO

ShenzhenIO Solutions as save folder
25 stars 8 forks source link

Virtual Reality Buzzer: 2 lines of code #10

Closed twarmboe closed 7 years ago

twarmboe commented 7 years ago

Solution is: ¥14/721/2

Had been told 2 lines was possible so I spent some time figuring it out.

The gist of the solution is that we use 2 PGA33X6 units since they each hold a bit of information and can run some basic logic.

In order to differentiate between the different inputs -999, 0, 1 we mov that data through a DX300. This results in the outputs 111, 000, 001 respectively. The two lowest bits go into PGA-1 to determine if we should be turned on or off (00=>off, 01 => on). PGA-1 will store this as its bit and pass it to PGA-2.

The gen 0 1 instruction acts a bit like a clock signal for PGA-2. It will be high for exactly one instruction (the slp 0 portion of the gen) per tick. PGA-2 will only change states while this line is high. PGA-2's bit is used to store if we were previously outputting a 100 as part of our generated output pulse.

It should not be possible to achieve lower than 2 lines with the current game mechanics/set of parts.

Rough proof:

  1. An MC is required to read values from a passive xbus source like the radio.
  2. Reading values from the radio is required to solve this puzzle
  3. In order to solve this puzzle we must be able to differentiate between all 3 possible inputs.
  4. From 1 and 2: We require an MC to solve this puzzle.
  5. Assume a single line program (called P) exists for this MC that solves this puzzle
  6. The instruction used in P must be a slp or gen in order for time to advance
  7. Neither the 'slp' nor 'gen' instruction is capable of differentiating between the three input values (more specifically both treat 0 and -999 the same).
  8. From 6 and 7: P is incapable of differentiating between the three input values.
  9. Our assumption in 5 has led to a contradiction between 8 and 3 so P can't exist.