平々毎々(アーカイブ)

はてなダイアリーのアーカイブです。

golf

smiley triangle

http://golf.shinh.org/p.rb?Smileys+Triangle

class P{static void Main(){string s=@":
:-
:-)";string t=@"
:-)";while(t.Length<65)s+=(t+="))");System.Console.Write(s);}}

これで(改行をLFにして)122B。107Bとか、どうするんだ。

(追記)nattowさんのエントリに110Bのコードが。

iを使い、string変数を1つだけにしている。おもしろいなあ。

そういや上のコードは少し削れますね。

class P{static void Main(){string s=@":
:-
:-)",t="\n:-)";while(t.Length<65)s+=(t+="))");System.Console.Write(s);}}

それか、nattowさんのコードを参考に、sの初期化を少し変えて

class P{static void Main(){string s=":\n:-",t="\n:-)";do s+=t;while((t+="))").Length<67);System.Console.Write(s);}}

でも両方とも115B。sとtで攻めるのは厳しいかな。