誰もSPLでコードゴルフチャレンジに参加できるほど痴呆になることはありません。
少し前の私自身の言葉。それでも、誰かがそれをするのに十分なほど痴呆になりました。はい、はい、知っています。バイトが多すぎます。しかし、SPLはここに含まれるに値する、と思います。そして私を信じて、私はこのプログラムを「ゴルフ」するために膨大な努力をしました、それが少し反復的であり、ほとんど同じ言葉を使用する理由です(私は常にDLoscの提案に従いましたが、それは私にとっても極端でした。
A Happy Birth Day
Ajax, a hero
Ford, a man
Act I: 1
Scene I: 1
[Enter Ajax and Ford]
Ajax:
You are nothing!
Scene II: 2
Ford:
Am I nicer than the sum of a big cow and a son?
Ajax:
If so, we shall go to Scene V. You are as big as the sum of thyself and a cat!
Scene III: 3
Ford:
You are as red as the sum of a big red warm rich bold fair cat and a big rich fine son.
Speak thy mind! You are as big as the sum of thyself and the sum of a cute fair fine
rich cat and a hog! Speak thy mind! You are as big as the sum of thyself and the sum
of a cute fair fine rich cat and a hog. Speak thy mind. Speak thy mind! You are as bold as
the sum of thyself and the sum of a big fine fair cat and a cow. Speak thy mind! You are
as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the sum of
thyself and the sum of a red old fair fine tiny cow and a big joy. Speak thy mind.
You are as red as the sum of thyself and the sum of the sum of a red old fair fine
tiny cow and a rich old red sky and a pig. Speak thy mind! You are as old as the sum
of thyself and the sum of a big fine fair joy and a son. Speak thy mind. You are as
red as the sum of thyself and a cute son. Speak thy mind! You are as cute as the sum
of thyself and the sum of a bad fat vile pig and a fat bad lie. Speak thy mind! You are
as fat as the sum of thyself and a vile evil war. Speak thy mind! You are as vile as the
sum of thyself and the sum of a pig and a toad. Speak thy mind! You are as fair as the
sum of thyself and the sum of a big fair hard fine son and a red fine fair joy. Speak
thy mind! Are you as old as a big cow?
Ajax:
If so, we shall go to Scene IV.
Ford:
You are as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the sum
of thyself and the sum of the sum of a big red warm rich bold fair cat and a red old fair
fine tiny cow and a bad hog. Speak thy mind! You are as big as the sum of thyself and the
sum of a fat bad hog and a war. Speak thy mind! You are as big as a red old fair fine tiny
cow. Speak thy mind! You are as old as the sum of thyself and the sum of a big red warm
rich bold fair cat and a fat foul bad hog and a son. Speak thy mind. You are as fat as
the sum of thyself and the sum of the sum of a big fair hard fine son and a big fine
fair joy and a bad pig. Speak thy mind.
Ajax:
Let us return to Scene II.
Scene IV: 4
Ford:
You are as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the
sum of thyself and a big red warm rich bold fair cat and a warm sky. Speak thy mind.
You are as fat as the sum of thyself and the sum of a red old fair fine tiny cow and a
cat. Speak thy mind. You are as fat as the sum of thyself and a bad foul hog. Speak
thy mind. You are as cute as the sum of thyself and the sum of a big fair hard fine
son and a sky. Speak thy mind. You are as big as a red old fair fine tiny cow. Speak thy
mind! You are as old as the sum of thyself and the sum of thyself and the sum of the sum
of the sum of a red old fair fine tiny cow and a big fair hard fine son and a big joy and
a son. Speak thy mind. You are as bad as the sum of thyself and the sum of a fat pig and a
hog. Speak thy mind. You are as fat as the sum of thyself and a lazy pig. Speak thy mind.
Ajax:
Let us return to Scene II.
Scene V: 5
[Exeunt]
このすべての意味は?
これらすべてがどのように機能するかについて知りたい場合は、私の推論を説明してみましょう。まず、変数。それらはシェイクスピア劇から来なければなりません。そして、タラクターの数が重要なので、小さいものを選ばなければなりません。このように、Ajax
とFord
表示されます。宣言後に説明が必要です(これは無視されますが、まだです)。一文字でも使えたかもしれませんが
第1幕、第1幕
var Ajax, Ford;
Ford = 0;
変数をステージに取り込み、彼の値が0になることをAjax
伝えFord
ます。
第1幕、シーンII
if (Ford > 2*1+1)
goto Scene V;
Ford = Ford + 1;
OK、保存されている値Ford
が3より大きい場合、プログラムはシーンVにジャンプします。それ以外の場合は、値が増分されます。
第1幕、シーンIII
Ford = 2*2*2*2*2*2*1+2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*1-1;
print((char) Ford);
Ford = Ford+2*2*2*2*1-1;
print((char) Ford);
print((char) Ford);
Ford = Ford+2*2*2*1+1;
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+2*2*2*1+(-1);
print((char) Ford);
Ford = Ford+2*2*2*1+1;
print((char) Ford);
Ford = Ford+2*1;
print((char) Ford);
Ford = Ford+2*2*2*(-1)+2*2*(-1);
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
Ford = Ford+2*(-1)+(-1);
print((char) Ford);
Ford = Ford+2*2*2*2*1+2*2*2*1;
print((char) Ford);
if (Ajax == 2*1)
goto Scene IV;
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*2*2*2*1+2*(-1);
print((char) Ford);
Ford = Ford+2*2*(-1)+(-1);
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*2*(-1)+1;
print((char) Ford);
Ford = Ford+2*2*2*2*1+2*2*2*1+2*(-1);
print((char) Ford);
Ford = Ford+2*2*2*1+2*-1;
print((char) Ford);
goto Scene II;
ラインの負荷および負荷。アイデアは、に格納されている値をいじって、Ford
算術演算のロードとロードを実行して、目的の文字のASCII番号を取得し、コンパイラーに数字を文字形式で出力するように指示することです。それがあなたの書く方法ですHappy Birthday
。if
このシーンの内部には、これが曲の3番目のフレーズであるかどうかを確認するという考え方があります。そうである場合、シーンIVにジャンプします。それ以外の場合は、書き込みを続行しますto You
。その後、シーンIIに戻ります。
第1幕、場面IV
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+1;
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
Ford = Ford+2*2*2*2*1+1;
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+2*2*2*2*1+2*1+1;
print((char) Ford);
Ford = Ford+2*(-1)+(-1);
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
goto Scene II;
これが機能する方法は上記のシーンに似ています:アイデアはを書くことDear SPL
です。
第1幕、シーンV
End.
そのように。
残念ながら、これをテストできる場所はまだ見つかりませんでした...