Talk:Lost

From Esolang
Jump to navigation Jump to search

Stringmode

I'm not sure I agree with the recent edits about strings. Execution wraps between left and right and between top and bottom (I assume; I can't find where the article says that but it's typical in this sort of language). So if the program starts executing from a quote mark (starting a string), it'll wrap around the program (pushing the text outside the string onto the stack), but then string mode will end at the other quote mark, meaning that the inside of the string will be executed as code. If you have a direction instruction inside what's normally the data part of the string (but which has now become code), then you can escape.

It's worth comparing this to the idea of a "topological quine", a common trick in 2D languages where you have an apparently unmatched quote mark. The string wraps around the whole program and back to the quote, meaning that the entire text of the program is inside and outside the string at the same time. This is of course useful in producing quines, as it effectively lets the program read its own source code. Ais523 non-admin (talk)

Yep, see e.g. this Hello, World! (which even has two quote marks) or this quine (halfway topological) on PPCG. However, the ones in this article indeed seem broken (tested by adapting the verification link in the PPCG quine). --Ørjan (talk) 02:28, 19 April 2018 (UTC)
Oh wait, the quine may work. But TIO cuts off the output before the verdict. --Ørjan (talk) 02:41, 19 April 2018 (UTC)
As I mentioned on IRC, the original Hello, World! in the example section works too. --Ørjan (talk) 03:01, 19 April 2018 (UTC)