Live data from Hacker News

My Adventure Writing My First Quine in Java

blogs.adobe.com

1–10 of 10 posts

Re: My Adventure Writing My First Quine in Java

#5

I consider this totally cheating: $ python quine.py import sys print open(sys.argv[0]).read(),

This misses the point of a Quine. You haven't written the code to generate the string, you've used an external library that someone else wrote to do that job for you.

I made this mistake the first time I tried too.

Re: My Adventure Writing My First Quine in Java

#7
In Lisp they're pretty easy:

((lambda (x) (list x (list 'quote x))) '(lambda (x) (list x (list 'quote x))))

returns itself (note: written in Clisp; I've had issues with Lispworks doing things properly). You can also stuff messages in there pretty easily:

((lambda (x y) (list x (list 'quote x) y)) '(lambda (x y) (list x (list 'quote x) y)) "Hello, world")

Re: My Adventure Writing My First Quine in Java

#9

I consider this totally cheating: $ python quine.py import sys print open(sys.argv[0]).read(),

This misses the point of a Quine. You haven't written the code to generate the string, you've used an external library that someone else wrote to do that job for you. I made this mistake the first time I tried too.

Oh I know, hence I called it "cheating"