empty input gets empty output, solved
A Quine Puzzle
11–20 of 36 posts
Re: A Quine Puzzle
#12Spoiler: cmVwZWF0IDMgMgpwcmludCAyCnJlcGVhdCAzIDIKcHJpbnQgMgpyZXBlYXQgMyAyCg==
Variant that doesn't rely on potentially undefined behavior of asking "repeat" to repeat before the beginning: cHJpbnQgMApwcmludCAyCnByaW50IDAKcHJpbnQgMgpwcmludCAwCnJlcGVhdCAzIDIKcHJpbnQgMgpyZXBlYXQgMyAyCnByaW50IDIKcmVwZWF0IDMgMgo=
Re: A Quine Puzzle
#13Spoiler: cmVwZWF0IDMgMgpwcmludCAyCnJlcGVhdCAzIDIKcHJpbnQgMgpyZXBlYXQgMyAyCg==
Re: A Quine Puzzle
#14My solution, featuring only 2 distinct commands, no NOPs, and not relying on `repeat` at the beginning: cHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg==
Re: A Quine Puzzle
#15My solution, featuring only 2 distinct commands, no NOPs, and not relying on `repeat` at the beginning: cHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg0KcHJpbnQgMg0KcmVwZWF0IDMgMg==
Maybe it copy-pasted wrong, but this doesn't look like a solution to me. The output is shorter than the input, and contains commands in a different order.
Re: A Quine Puzzle
#16Re: A Quine Puzzle
#17 cHJpbnQgMQpwcmludCAxCnByaW50IDEKcHJpbnQgMQpwcmludCAxCnByaW50IDEKcmVwZWF0IDMg
MgpwcmludCAyCnJlcGVhdCAzIDIKcHJpbnQgMgpyZXBlYXQgMyAyCgo=
Wasn't terribly difficult, though not the shortest. What's the code golf answer?Re: A Quine Puzzle
#18It should be possible to write a zip (rar?) file that encodes a PRNG, such that it contains one zip: itself with the PRNG stepped forward one. (Even a "PRNG" that just outputs 1, then 11, then 111, etc, would be sufficient in most cases)
The hard part is making sure the checksum is consistent.
This would wreak havoc with any file checker that checks for recursive archive files.
Re: A Quine Puzzle
#19Earlier quoted context omitted.
Variant that doesn't rely on potentially undefined behavior of asking "repeat" to repeat before the beginning: cHJpbnQgMApwcmludCAyCnByaW50IDAKcHJpbnQgMgpwcmludCAwCnJlcGVhdCAzIDIKcHJpbnQgMgpyZXBlYXQgMyAyCnByaW50IDIKcmVwZWF0IDMgMgo=
Good eye. Also, https://github.com/wgreenberg/quine.zip/blob/gh-pages/test/i...
Re: A Quine Puzzle
#20I kinda assumed that the interpreter was just there for convenience, and that its implementation of undefined behavior was irrelevant. But is the interpreter's implementation critical to the solution?
(Then again, I'm now reading the examples and realizing that the implementation of undefined behavior was front-and-center, so that's kinda my bad xP)