Page 2 of 2

Posted: Mon 11 Dec, 2006 5:04 pm
by benryves
thegamefreak0134 wrote:In a computer language it would be easy enough. You simply have the source separate from the compiled file, and you have the program read that file, and then display it onscreen. In VB.NET I would copy that code to a multi-line text box, but in C or C++ you could simply spit it out to the console.
You may not do that for it to be a valid quine.

Posted: Mon 11 Dec, 2006 5:07 pm
by thegamefreak0134
Oh. Well nobody ever said that, sorry. Well poo. It doesn't seem very possible then...

Posted: Mon 11 Dec, 2006 9:42 pm
by KevinJB
Obviously it is :-P But it's one of those things that's difficult to wrap your brain around at first.

Posted: Mon 11 Dec, 2006 10:31 pm
by Timendus
Hmm, it is... it adds a nice recursive problem:

To output "Hello world", you'd need:
:Output("Hello world
So to output it's source, you'd need:
:Output("Output("Hello world
Oh, no, wait, now the source has changed, so it has to become:
:Output("Output("Output("Hello world

Aaargh :P

What if I'd write an assembly program that would spit out the bytes that it consists of? :) Would be an easy contest in Brainfuck, I'd imagine.

Posted: Tue 12 Dec, 2006 3:33 am
by anykey
Wow. Brainfuck doing something...EASILY?!
Too good to be true...I doubt it!

Posted: Tue 12 Dec, 2006 3:44 am
by elfprince13
/me thinks this would be much easier in an interpreted language like python.....

Posted: Tue 12 Dec, 2006 11:09 am
by benryves
thegamefreak0134 wrote:Oh. Well nobody ever said that, sorry. Well poo. It doesn't seem very possible then...
Well, if you allow that, for extra bonus points you could get the program to compile itself too. :)

Here's a quine in HQ9+:

Code: Select all

Q