ようこそ。睡眠不足なプログラマのチラ裏です。

ゆの in C#

元ネタ存じ上げませんが、「ゆの in language」っちゅーハック遊びが
ここ最近流行っていたらしいので、C#でも。


ええまあ、なんの捻りもなく演算子のオーバーロードですが…(^ω^;)サーセン

using System;

namespace ConsoleApplication1
{
    public partial class Program
    {
        static void Main(string[] args){
            int? yuno = X / _ / X < "来週も見てくださいね!";
            Console.Read();
        }
    }

    public partial class Program
    {
        static int _ = 365;
        static x X = new x();

        private class x
        {
            public override string ToString() { return string.Empty; }
            public static x operator /(x a, int b)
            {
                Console.Write("ひだまりスケッチ");
                Console.Write(b);
                return a;
            }
            public static x operator /(x a, x b) { return b; }
            public static int? operator <(x a, String b) { Console.Write(b); return null; }
            public static int? operator >(x a, String b) { return null; }
        }
    }
}

でってゆーwww

#追記:冗長な部分、若干修正しました。