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 막
var Ajax, Ford;
Ford = 0;
우리는 단계로 변수를 가져오고하게 Ajax
말해 Ford
자신의 값이 0이 될 것입니다.
제 1 막
if (Ford > 2*1+1)
goto Scene V;
Ford = Ford + 1;
저장된 값 Ford
이 3보다 크면 프로그램은 장면 V로 점프합니다. 반면에 그 값은 증가합니다.
1 막
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
내부는이 장면 : 아이디어는이 노래의 세 번째 문구가 있는지 확인하는 것입니다; 만약 그렇다면, 우리는 장면 IV로 점프합니다; 그렇지 않으면 우리는 계속해서 글을 쓴다 to You
. 그런 다음 Scene II로 돌아갑니다.
1 막, 4 막
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.
그냥 그렇게
불행히도 테스트 할 수있는 곳을 아직 찾지 못했습니다 ...