My Adventure Writing My First Quine in Java
blogs.adobe.com
My Adventure Writing My First Quine in Java
1–10 of 10 posts
Re: My Adventure Writing My First Quine in Java
#2 $ python quine.py
import sys
print open(sys.argv[0]).read(),Re: My Adventure Writing My First Quine in Java
#3I consider this totally cheating: $ python quine.py import sys print open(sys.argv[0]).read(),
Sometimes writing python literally feels like taking candy from a baby
Re: My Adventure Writing My First Quine in Java
#4I consider this totally cheating: $ python quine.py import sys print open(sys.argv[0]).read(),
Re: My Adventure Writing My First Quine in Java
#5I consider this totally cheating: $ python quine.py import sys print open(sys.argv[0]).read(),
I made this mistake the first time I tried too.
Re: My Adventure Writing My First Quine in Java
#6Re: My Adventure Writing My First Quine in Java
#7((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
#8And here's a little write-up on how I approached the problem: https://nolancaudill.com/2011/01/01/how-to-build-a-quine/
Re: My Adventure Writing My First Quine in Java
#9I 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
#10 def q(s):
print(s+'q(""' '"'+s+'"' '"")')
q("""def q(s):
print(s+'q(""' '"'+s+'"' '"")')
""")