您说最美丽的版本?然后,让我们尝试一下...
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斗争后在这里,我觉得我必须做至少一个提交它的任何挑战。就是这样。
那么,这是什么呢?
因此,首先,我们声明将在整个程序中使用的变量,这些变量必须来自莎士比亚戏剧。厌倦了罗密欧,朱丽叶,奥菲莉亚和奥赛罗,我去了坎特伯雷大主教和卡普莱特夫人。解析器不接受它们的描述以及使徒行传/场景的标题,因此您可以在其中放置几乎任何您喜欢的东西。
因此,让我们来做翻译之王,以免有些乱码。
第一幕,第一幕
Begin
Lady Capulet = 0;
第一幕非常简单:我们将变量初始化为0。
第一幕第二场
Lady Capulet += 1;
if(Lady Capulet < Math.pow((2*2*1+1)*(2*1),2))
continue;
else
goto Scene VIII;
我们增加Lady Capulet的值并将其与100进行比较(是的,整个句子仅用于获得数字100);如果不小的话,我们跳到场景VIII(最后);否则,我们继续下一个场景。
第一幕第三幕
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。如果不是,我们跳到第四场景。如果是这样,我们就开始进行算术运算并将其存储在Archieperson中,一旦找到所需的字符,就以字符形式输出它们。是的,最终的想法是得到Fizz
。
第一幕,第四场
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
。
第一幕,第五幕
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
;唯一的不同是,最后,我们跳过了一个场景。
第一幕第六幕
System.out.print(Lady Capulet);
要到达此场景,Capulet夫人假定的号码一定既不是Fizz也不是Jazz也不是Buzz。因此,我们以数字形式输出它。
第一幕,第七场
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;然后,我们返回到场景II,继续执行该程序。
第一幕,第八场
End.
直截了当。
我仍在尝试查看是否可以在线显示此编译器,但是我找不到在线编译器- 我知道的编译器似乎无法与任何程序很好地结合,除非已经加载了某个程序,或者可能是某种键盘和椅子之间的接口问题...
更新1:
在mathmandan发表评论之后,我编辑了Jazz和Buzz场景的顺序。这必须要完成。