quine in c#

A formatted version of the quine that I wrote in 2006

using System;
class MainApp
{
    public static void Main()
    {
        // quotation mark --> "
        char q = Convert.ToChar(34);

        // --> string b =
        string var = string.Concat(Convert.ToChar(115), Convert.ToChar(116), 
                Convert.ToChar(114), Convert.ToChar(105), Convert.ToChar(110), 
                Convert.ToChar(103), Convert.ToChar(32), Convert.ToChar(98), 
                Convert.ToChar(32), Convert.ToChar(61));

        // --> semicolon
        char s = ';';

        string a = "using System; class MainApp { public static void Main() { 
                char q = Convert.ToChar(34); string var = string.Concat(Convert.ToChar(115), 
                Convert.ToChar(116), Convert.ToChar(114), 
                Convert.ToChar(105), Convert.ToChar(110), 
                Convert.ToChar(103), Convert.ToChar(32), 
                Convert.ToChar(98), Convert.ToChar(32), 
                Convert.ToChar(61));   char s = ';'; string a = ";

        string b = "Console.WriteLine(a + q + a + q + s);Console.WriteLine( var + q + b + q + s + b); } }";


        Console.WriteLine(a + q + a + q + s); 
        Console.WriteLine(var + q + b + q + s + b);

    }
}

No comments:

Post a Comment

Latest Posts

Popular Posts