📜 ⬆️ ⬇️

Introspective program

Most likely, you have heard about the well-known problem invented by Norbert Wiener.

The task is to write a program that, in the course of its work, displays its source code on the screen or in a file. It goes without saying that you cannot use a file with code or system information, such as the address of a memory cell, possibly containing this code.

Such a program is called introspective . There is also a theorem that states that it is possible to write such a program in any programming language.
')
PS The problem for me is particularly interesting in terms of web programming languages.

I am aware that the topic is a place in "Entertaining tasks" , but Habr does not allow to write there. Most likely due to lack of karma, although the system motivates refusal by my lack of presence in this blog, which is very strange. I received the same answer on an attempt to publish a puzzle in “I am smart”

Source: https://habr.com/ru/post/12404/


All Articles