Hacker News new | ask | show | jobs
by moritzwarhier 748 days ago
This is mind-blowing to me, how the shapes of the digits are encoded in the ten numbers, the sheer brevity of that script.

Wow

1 comments

Partly because it is not exactly a "proper" quine, which is not allowed to access its own source code in any way. This program uses the fact that JS requires `Function.prototype.toString()` to return something that resembles the original JS source code [1], which can be regarded as reading its own source code (a more precise statement would be that it relies on an implementation-defined behavior though). A proper quine in comparison tends to be longer because it has to repeat itself twice in general.

[1] https://tc39.es/ecma262/#sec-function.prototype.tostring

I get what you are saying about using Function.prototype.toString, I am more fascinated by the coloring according to the datetime string, than by the quine aspect. If it were only about the latter, I agree that it wouldn't be very interesting (or not even a proper quine)