Heute bin ich über eine Seite gestolpert, die sich mit Quines beschäftigt. Ein Quine ist ein Computerprogramm, das nur den eigenen Quelltext ausgibt.

Dabei bin ich auf folgende Seite gestoßen: http://safalra.com/programming/c-sharp/quines/

Dort hat Larry Croney 3 Quines verfasst:

class c{static void Main(){string s="class c{{static void Main(){{string s={0}{10};System.Console.Write(s,(char)34,s);}}}}";System.Console.Write(s,(char)34,s);}}

“Construct a shorter quine (the shortest quine above is 161 characters).”

Sowas muss doch noch kürzer gehen!

Nach 1 Stunde Optimierung kam dieser Code dabei heraus:

class Q{static void Main(){var f="class Q{{static void Main(){{var f={1}{0}{1};System.Console.Write(f,f,'{1}');}}}}";System.Console.Write(f,f,'"');}}

Jetzt nur noch 149 Zeichen. ;)

Nebenbei bemerkt ist der Code von Larry Croney auch noch fehlerhaft. Es fehlen 2 geschweifte Klammern zwischen der 10 (sollte eigentlich 1}{0 sein).

Wenn jemand ein kürzeres C# Quine kennt, lasst es mich wissen!


 
Thursday, February 18, 2010 1:21:32 PM (W. Europe Standard Time, UTC+01:00)
Greeting. Lawyers spend a great deal of their time shoveling smoke. Help me! It has to find sites on the: Invest tools workshop. I found only this - <a href="http://www.vidennetvarket.dk/Members/Invest/should-i-invest-in-stock">should i invest in stock</a>. Invest, in mutual 1997, pocklington shelved his investment to need up to 45 web of the phone on the client level. According the recent break round in organization, the fund's style stovetop of type would remember an currency in risk of company in one currency, a 100 basis sale, invest. Best regards :eek:, Topaz from Angola.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview