Created
July 12, 2015 16:34
-
-
Save KvanTTT/48f10cc8c4652b29f17e to your computer and use it in GitHub Desktop.
QuineClock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo off | |
| :LOOP | |
| "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "QuineClock.cs" | |
| "QuineClock.exe" > "QuineClock.cs" | |
| type "QuineClock.cs" | |
| goto LOOP | |
| :END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System;using System.Text;class e{static string[]d=new[]{ | |
| " ----- | || || || || || | ----- ", | |
| " --+ / | / | | | | | ----+--", | |
| " ----- | | / / / / / +------", | |
| " ---- | ! / / ! !| / ---- ", | |
| " /| / | / | / | +----| | | ----", | |
| "+------| | +----- | | |------ ", | |
| " ----- | | +----- | || || | ----- ", | |
| "------+ | / / / / / / ", | |
| " ----- | || | ----- | || || | ----- ", | |
| " ----- | || | -----+ | | | ----- "};static StringBuilder | |
| j;static string k(DateTime a){var b=Environment.NewLine;j=new StringBuilder(b+b) | |
| ;p("//"+b);for(int c=0;c<8;c++){p("// ");l(a.Hour,c);m(c);l(a.Minute,c);m(c);l( | |
| a.Second,c);p(b);}p("//"+b+"//"+string.Format("{0,62}", | |
| "Quine Clock by KvanTTT, 2014")+b+b);return j.ToString();}static void l(int a, | |
| int b){p(d[a/10].Substring(b*7,7).Replace('!','\\'));p(" ");p(d[a%10].Substring | |
| (b*7,7).Replace('!','\\'));}static void m(int a){p(" ");p(a==1|a==2|a==4|a==5? | |
| "++":" ");p(" ");}static void p(string s){j.Append(s);}static void Main(){var | |
| a=TimeSpan.TicksPerSecond;var n=DateTime.Now;var b=n.AddTicks(a-(n.Ticks%a));var | |
| c=(b.Ticks-n.Ticks)*1000/a-50;if(c<0)c=0;System.Threading.Thread.Sleep((int)c); | |
| var o=k(b);var s= | |
| "using System;using System.Text;class e{{static string[]{4}=new[]{{{3}}};static StringBuilder j;static string k(DateTime a){{var b=Environment.NewLine;j=new StringBuilder(b+b);p({1}//{1}+b);for(int c=0;c<8;c++){{p({1}// {1});l(a.Hour,c);m(c);l(a.Minute,c);m(c);l(a.Second,c);p(b);}}p({1}//{1}+b+{1}//{1}+string.Format({1}{{0,62}}{1},{1}Quine Clock by KvanTTT, 2014{1})+b+b);return j.ToString();}}static void l(int a,int b){{p({4}[a/10].Substring(b*7,7).Replace('!','{2}{2}'));p({1} {1});p({4}[a%10].Substring(b*7,7).Replace('!','{2}{2}'));}}static void m(int a){{p({1} {1});p(a==1|a==2|a==4|a==5?{1}++{1}:{1} {1});p({1} {1});}}static void p(string s){{j.Append(s);}}static void Main(){{var a=TimeSpan.TicksPerSecond;var n=DateTime.Now;var b=n.AddTicks(a-(n.Ticks%a));var c=(b.Ticks-n.Ticks)*1000/a-50;if(c<0)c=0;System.Threading.Thread.Sleep((int)c);var {5}=k(b);var s={1}{0}{1};Console.Write(s,s,'{1}','{2}{2}','{1}'+string.Join({1}{2}{1},{2}{1}{1},{4})+'{1}',{1}d{1},{1}o{1},{5});}}}}{6}" | |
| ;Console.Write(s,s,'"','\\','"'+string.Join("\",\"",d)+'"',"d","o",o);}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while ($true) { | |
| &"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "QuineClock.cs" | |
| ./"QuineClock.exe" > "QuineClock.cs" | |
| type "QuineClock.cs" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while : | |
| do | |
| mcs "QuineClock.cs" | |
| mono "QuineClock.exe" > "QuineClock.cs" | |
| cat "QuineClock.cs" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment