HP Forums

Full Version: The challenge: BASIC program which produce the same on LIST or RUN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One of the best logical/programmer's challenge I can remember, was published in one of the first computer magazines in the country about 3 decades ago, had following short definition (paraphrased):

"Make the shortest BASIC program which produce exactly the same output on RUN or LIST, i.e. the program which list himself. In the program is forbidden to use LIST, PEEK, POKE, USR or similar commands specific for the implementation - it is allowed to use only standard BASIC commands and functions."

From today perspective, it looks to me almost naive, even the problem itself is basically not naive at all. I remember I have also applied solution and received some reward for shortest solution based on strings. I remember of this with strong nostalgia - good old pioneers days!

Perhaps solution of this challenge may be possible as well on some old HP calculator models have implemented BASIC?

Have a nice fun!
Cf. Quine

Cheers
Thomas
(10-03-2018 07:35 AM)Thomas Klemm Wrote: [ -> ]Cf. Quine

Cheers
Thomas

The article is an overkill for valid and short solutions in BASIC.
It is forbidden by definition to use LIST inside the program.

The solution with files is obvious and valid one. However, there is other two differently based approaches, on what the challenge aims...
Reference URL's