![]() |
Quine - self replicating code
ok,
I was shown this today and asked to try it out by a friend, so far what I can come up with might fail, I will get it eventually but, I was going to see how many people would like to try it. http://www.nyx.net/~gthompso/quine.htm http://en.wikipedia.org/wiki/Quine it can be done in most programming languages. try to do it without cheating. ik p.s. I searched the forum for this, and it only came up with a quiz, so nothing else has been posted, i think |
Re: Quine - self replicating code
Quote:
I use LISP on an almost daily basis, but I really cannot get myself to understand this (allegedly) classic quine: ((lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x))))) I'm not sure it counts though, as (in CLISP) some quotes become 's as below [11]> ((lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x))))) ((LAMBDA (X) (LIST X (LIST 'QUOTE X))) '(LAMBDA (X) (LIST X (LIST 'QUOTE X)))) [12]> |
Re: Quine - self replicating code
I done it in java, although I am not convinced it is an exact replica, but it is close.
I was thinking about also finding the file and echoing the file to the screen, not sure if this is against the rules? Code:
class QuineTestik |
Re: Quine - self replicating code
That looks pretty impressive! :tu: I don't know Java though, so I haven't a clue as to what it does :)
But don't you have an additional semicolon in the output (last character)? |
| All times are GMT. The time now is 14:33. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum