Coding a Quine in J

279 Views Asked by At

Am I missing some key part in the definition of a quine, because this seems far too easy to be considered even worthwhile in J.

NB. commentary for Quine code

verbatim =: (3 : 0)''

smoutput 1!:1 <'filename' NB. where 'filename' would obviously be the pathway to the script file

)

This seems to do exactly what the definition of a quine is: outputting the source code of the action. Is this it?

1

There are 1 best solutions below

0
On

Yes, you're missing part of the normal definition. A quine should do no input. I think this is precisely to disallow this trick.

There are some J quines on the J wiki.