A Quine: A program which produces its own source code as ou…

Twetch ·

A Quine:
A program which produces its own source code as output.

Also a Quine:
Scottish word for girl —> which is also a program which produces its own source code as output.

🤯

https://twetch.app/t/6149e3679b63c8b20dd3a7d794ec279e84532614b2023d04e7ad2e21e2f620fe

Replies

Twetch ·

something like `curl --libcurl out.c` or a complete source?

Twetch ·

you must be fae the highland. i never heard that word before..Quine goes back to Old English cwen, meaning a woman, wife or, as in modern English, a queen. or Older Scottish Tongue "quyne" refer mainly to young women in service or of poor financial means👍

Twetch ·

The latter

Eg. JavaScript

(function a(){console.log('('+a+')()')})()

Twetch ·

Eg. Bash

s='s=\47%s\47;printf "$s" "$s"';printf "$s" "$s"

Twetch ·

So a quine is a thing of interpreted langs?

Twetch ·

Anything, here's C:

main(){char*s="main(){char*s=%c%s%c;printf(s,34,s,34);}";printf(s,34,s,34);}

Source:
https://cs.lmu.edu/~ray/notes/quineprograms/

Twetch ·

lol