Skip to content

Instantly share code, notes, and snippets.

@secretGeek
Created February 3, 2016 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save secretGeek/8bf44d09485b1cb0b3c1 to your computer and use it in GitHub Desktop.
Save secretGeek/8bf44d09485b1cb0b3c1 to your computer and use it in GitHub Desktop.
using System;
namespace Quine
{
class Program
{
static string[] program = new string[] {
"using System;",
"namespace Quine",
"{",
" class Program",
" {",
" static string[] program = new string[] {",
" };",
" static void Main(string[] args)",
" {",
" for (int i = 0; i < program.Length; i++ )",
" {",
" Console.WriteLine(program[i]);",
" if (i == 5)",
" {",
" for (int j = 0; j < program.Length; j++)",
" {",
" Console.WriteLine(\" \\\"\" + program[j].Replace(@\"\\\", @\"\\\\\").Replace(\"\\\"\", \"\\\\\\\"\") + \"\\\", \");",
" }",
" }",
" }",
" }",
" }",
"}",
};
static void Main(string[] args)
{
for (int i = 0; i < program.Length; i++ )
{
Console.WriteLine(program[i]);
if (i == 5)
{
for (int j = 0; j < program.Length; j++)
{
Console.WriteLine(" \"" + program[j].Replace(@"\", @"\\").Replace("\"", "\\\"") + "\", ");
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment