Mike Stok wrote: > On Sat, 1 Sep 2001, John Tromp wrote: > >> The web page >> http://www.nyx.net/~gthompso/quine.htm >> >> shows self-reproducing programs, aka "quine"s for many languages, >> but Ruby is conspicuously missing. >> What would be the shortest Ruby program to output itself? >> >> I don't suppose it could be as short as in python? : >> l='l=%s;print l%%`l`';print l%`l` Well, I just hacked one together: x=%q/puts "x=%q\057#{x}\057;#{x}"/;puts "x=%q\057#{x}\057;#{x}" Now that I look at them together, they look rather similar. Hmmm... It could have been a bit shorter, but I wanted to be able to pass it to the interpreter on the command line. I'm sure it could be shortened further. Anyway, I submitted this one earlier, so at least we'll have an entry. Incidently, the site accepts multiple submissions per language, so if you create any interesting ones, submit them. --- SER -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----