Suggestion: A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby T. follow the discussion. Please reply to
the original quiz message, if you can.
This week’s quiz is to create a quine[1], that is: a program which
receives no input and produces a copy of its own source code as its
only output.
I have mine down to down to one line (29 characters), though I
suspect everyone will agree I’m cheating.
I have 30 characters, w/out cheating. It does output a warning
on 1.8.6, but not 1.8.7 or 1.9.1. (And since the warning is on
stderr, it doesn’t affect the quine output really, I guess.)
I’ve got one that is more than 40 characters, but it’s readable!
Did you mean: ((I’ve got (one)) (that is more than ((40) characters)), ((but) (it’s readable!)) ?
Well I could have done something like that, yes, but I restrained myself
this time
Too bad we’ve got only oneliners, a subsidiary questions would have
been to produce a reversed quine, a quine that outputs the source
lines in the reverse order. (In C it’s funny).
Ok, I’m at 17 if I cheat & assume *NIX.
and 28 if I don’t cheat.
Still kinda fun, though… the one at 28 bytes is not anything I’d use
in real life, however. Definitely not maintainable.
Matt
–
“… if you do follow your bliss you put yourself on a kind of
track that has been there all the while, waiting for you, and the life
that you ought to be living is the one you are living. When you can
see that, you begin to meet people who are in your field of bliss, and
they open doors to you. I say, follow your bliss and don’t be afraid,
and doors will open where you didn’t know they were going to be.” –
Joseph Campbell
“… if you do follow your bliss you put yourself on a kind of
track that has been there all the while, waiting for you, and the life
that you ought to be living is the one you are living. When you can
see that, you begin to meet people who are in your field of bliss, and
they open doors to you. I say, follow your bliss and don’t be afraid,
and doors will open where you didn’t know they were going to be.” –
Joseph Campbell