가장 아름다운 버전입니다. 그럼 이걸로 해보자 ...
The Marvelously Insane FizzBuzzJazz Program.
Lady Capulet, an old bossy woman that loves to count.
The Archbishop of Canterbury, an old fart who adores to spit out letters.
Act I: The only one of them.
Scene I: The Archbishop of Canterbury is a bastard.
[Enter The Archbishop of Canterbury and Lady Capulet]
The Archbishop of Canterbury:
You are nothing!
Scene II: Count, Lady Capulet, count.
The Archbishop of Canterbury:
You are as beautiful as the sum of yourself and a cat!
Lady Capulet:
Am I worse than the square of the product of the sum of a warm gentle flower and a rose
and my pretty angel?
The Archbishop of Canterbury:
If not, let us proceed to Scene VIII.
Scene III: Fizzing to no end!
The Archbishop of Canterbury:
Is the remainder of the quotient between yourself and the sum of a happy cow and a
chihuahua as good as nothing?
Lady Capulet:
If not, let us proceed to Scene IV. Thou art as handsome as the sum of the sum of
the sweetest reddest prettiest warm gentle peaceful fair rose and a happy proud kindgom
and a big roman. Speak thy mind!
Thou art as fair as the sum of thyself and a honest delicious cute blossoming peaceful
hamster. Thou art as cunning as the sum of the sum of an embroidered King and a horse
and thyself. Speak thy mind!
Thou art as amazing as the sum of the sum of a good happy proud rich hero and a hair and
thyself! Speak thy mind.
Speak your mind!
Scene IV: Milady, there is jazz in thy robe.
The Archbishop of Canterbury:
Is the remainder of the quotient between yourself and a proud noble kingdom as good as
nothing?
Lady Capulet:
If not, let us proceed to Scene V. You are as charming as the sum of the sum of a noble
cunning gentle embroidered brave mighty King and a big warm chihuahua and an amazing
pony! Speak your mind!
You are as prompt as the sum of yourself and a big black sweet animal. You are as noble
as the sum of the sum of a gentle trustworthy lantern and yourself and a hog. Speak your
mind!
You are as bold as the sum of the sum of yourself and a good delicious healthy sweet
horse and my smooth cute embroidered purse. You are as peaceful as the sum of a flower
and yourself. Speak your mind.
Speak your mind!
Scene V: Buzz me up, Scotty!
The Archbishop of Canterbury:
Is the remainder of the quotient between yourself and the sum of a gentle happy cow and a
chihuahua as good as nothing?
Lady Capulet:
If not, let us proceed to Scene VI. Thou art as handsome as the sum of the sweetest
reddest prettiest warm gentle peaceful fair rose and a small town. Speak your mind!
You are as prompt as the sum of yourself and a big healthy peaceful fair rich kingdom.
You are as loving as the sum of the sum of an embroidered King and a horse and thyself.
You are as amazing as the sum of yourself and a cute fine smooth sweet hamster. Speak
your mind!
You are as prompt as the sum of the sum of yourself and an amazing cunning Lord and a
hair. Speak your mind.
Speak your mind!
The Archbishop of Canterbury:
Let us proceed to Scene VII.
Scene VI: Output or die!
The Archbishop of Canterbury:
Open your heart!
Scene VII: Oh, to jump the line.
Lady Capulet:
You are as handsome as the sum of a proud noble rich kingdom and a rural town. Speak your
mind! You are as gentle as the sum of the sum of yourself and a green mistletoe and my
father. Speak your mind!
The Archbishop of Canterbury:
We must return to Scene II.
Scene VIII: Goodbye, cruel world!
[Exeunt]
그래서 여기 SPL과의 투쟁 후 , 나는 도전에 대해 적어도 하나의 제출 을해야한다고 느꼈습니다 . 그리고 이것입니다.
그럼이게 다 뭐야?
먼저, 프로그램 전체에서 사용할 변수를 선언합니다. 셰익스피어 연극에서 가져와야합니다. 로미오, 줄리엣, 오펠리아, 오델로와의 연합에서 나는 캔터베리 대주교 와 레이디 캐 플릿 과 함께 일했다 . Acts / Scenes 타이틀뿐만 아니라 그들의 설명은 파서에 의해 무시되므로, 당신은 당신이 좋아하는 거의 아무것도 넣을 수 있습니다.
이제 번역의 왕을 조금 덜 우스운 것으로 바꾸자 .
제 1 막
Begin
Lady Capulet = 0;
액트 I은 매우 간단합니다. 변수를 0으로 초기화합니다.
1 막 2 장
Lady Capulet += 1;
if(Lady Capulet < Math.pow((2*2*1+1)*(2*1),2))
continue;
else
goto Scene VIII;
Lady Capulet의 값을 증가시키고 100과 비교합니다 (예, 문장 전체가 숫자 100을 얻는 데만 사용됨). 작지 않으면 Scene VIII (끝)으로 이동합니다. 그렇지 않으면 다음 장면으로 넘어갑니다.
1 막
if(Lady Capulet % (2+1) == 0)
continue;
else
goto Scene IV;
The Archbishop of Canterbury = 2*2*2*2*2*2*1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2*2*2*2*1;
The Archbishop of Canterbury += 2*1+1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2*2*2*1+1;
System.out.print((char)The Archbishop of Canterbury);
System.out.print((char)The Archbishop of Canterbury);
먼저, 3으로 나누는 계수가 0인지 확인합니다. 그렇지 않은 경우 장면 IV로 이동합니다. 그렇다면 산술 연산을 시작하고 Archieperson에 저장하여 원하는 것을 찾으면 문자 형태로 출력합니다. 예, 결국 아이디어는 Fizz
입니다.
1 막, 4 막
if(Lady Capulet % (2*2) == 0)
continue;
else
goto Scene V;
The Archbishop of Canterbury = 2*2*2*2*2*2*1+2*2*1+2*1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2*2*1;
The Archbishop of Canterbury += 2*2*1+(-1);
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2*2*2*1+2*2*2*1;
The Archbishop of Canterbury += 1;
System.out.print((char)The Archbishop of Canterbury);
System.out.print((char)The Archbishop of Canterbury);
먼저 4로 나누기의 계수가 0인지 확인한 다음에 대해 이전과 동일한 장면으로 계속합니다 Jazz
.
1 막, 장면 V
if(Lady Capulet % (2*2+1) == 0)
continue;
else
goto Scene VI;
The Archbishop of Canterbury = 2*2*2*2*2*2*1+2*1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2*2*2*2*1;
The Archbishop of Canterbury += 2*1+1;
The Archbishop of Canterbury += 2*2*2*2*1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*2+1;
System.out.print((char)The Archbishop of Canterbury);
System.out.print((char)The Archbishop of Canterbury);
goto Scene VII;
앞의 두 개와 같은 기능으로 5의 나눗셈 계수가 0을 반환하는지 확인한 다음 쓰기를 시도합니다 Buzz
. 유일한 차이점은 결국 장면을 건너 뜁니다.
1 막, 장면 VI
System.out.print(Lady Capulet);
이 장면에 도달하려면 Lady Capulet이 가정 한 숫자가 Fizz 나 Jazz, Buzz가 아니어야합니다. 따라서 숫자 형식으로 출력합니다.
1 막, 장면 VII
The Archbishop of Canterbury = 2*2*2*1+2*1;
System.out.print((char)The Archbishop of Canterbury);
The Archbishop of Canterbury += 2*1+1;
System.out.print((char)The Archbishop of Canterbury);
goto Scene II;
따라서 이것이 다음 줄로 넘어가는 유일한 방법입니다. 출력, 먼저 CR, LF; 그런 다음 Scene II로 돌아가서 프로그램을 계속할 수 있습니다.
1 막, VIII 장
End.
충분히 간단합니다.
나는 아직도 이것이 온라인에서 실행되고 있는지 보여 주려고 노력하고 있지만 온라인 컴파일러를 찾을 수 없습니다. 알고 있는 프로그램은 이미로드 된 프로그램을 제외하고는 어떤 프로그램과도 잘 어울리지 않는 것 같습니다. 키보드와 의자 사이의 인터페이스 문제
업데이트 1 :
mathmandan의 의견을 듣고 Jazz와 Buzz의 장면 순서를 편집했습니다. 해야 했어요.