H
henon
:quine: /kwi:n/ /n./ [from the name of the logician Willard van Orman
Quine, via Douglas Hofstadter] A program that generates a copy of its
own source text as its complete output. Devising the shortest
possible quine in some given programming language is a common hackish
amusement. (see http://www.nyx.net/~gthompso/quine.htm)
hi,
i have created this quine of length 32 and i believe that a
nonzero-ruby-quine cannot be shorter and more in the spirit of ruby than
that:
eval s=%q(puts"eval s=%q(#{s})")
until anyone comes up with a shorter nonzero quine i claim this to be
the shortest nonzero-ruby-quine.
it's even shorter than the shortest (i know of) in python:
l='l=%s;print l%%`l`';print l%`l`
which has 33 characters.
i have created a rubygarden wiki page for quines:
http://www.rubygarden.org/ruby?RubyQuines
you can see there ruby-quines i found qoogling the web
cheers,
-- henon