Hacker News new | ask | show | jobs
by titzer 1356 days ago
I hadn't written one until ~30 mins ago [1]. I cheated and looked at a Java quine (not particularly elegant, but easy to see what is going on.), but I wrote one for Virgil. Just think string substitution; a string with a hole in it and you substitute a copy of the string, quoted into the hole. Just one substitution suffices.

[1] https://github.com/titzer/virgil/blob/master/apps/Quine/Quin...

2 comments

You should put SPOILER tags on that.
Nice, this Go version satisfies gofmt:

https://github.com/62726164/quine