¿La versión más bonita, dices? Entonces, probemos este en ...
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]
Entonces, después de mi lucha con SPL aquí , sentí que tenía que hacer al menos una presentación con él en cualquier desafío. Y ya está.
Entonces, ¿qué es todo esto entonces?
Entonces, primero, declaramos las variables que vamos a usar en todo el programa, que deben provenir de las obras de Shakespeare. Harto de Romeo, Julieta, Ofelia y Otelo, fui con el arzobispo de Canterbury y Lady Capulet . El analizador no tiene en cuenta sus descripciones, así como los títulos de los Actos / Escenas, por lo que puede poner casi todo lo que quiera.
Entonces, hagamos un poco de traducción a algo un poco menos galimatías .
Acto I, Escena I
Begin
Lady Capulet = 0;
El acto I es bastante sencillo: inicializamos nuestra variable con 0.
Acto I, Escena II
Lady Capulet += 1;
if(Lady Capulet < Math.pow((2*2*1+1)*(2*1),2))
continue;
else
goto Scene VIII;
Incrementamos el valor de Lady Capulet y lo comparamos con 100 (sí, esa oración completa sirve únicamente para obtener el número 100); si no es más pequeño, saltamos a la escena VIII (el final); de lo contrario, continuamos a la siguiente escena.
Acto I, escena III
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);
Primero, vemos si el módulo de la división por 3 es 0; si no es así, saltamos a la escena IV; si es así, comenzamos a realizar operaciones aritméticas y a almacenarlas en el Archieperson, emitiéndolas en forma de caracteres una vez que encontremos la que estamos buscando. Sí, al final, la idea es llegar Fizz
.
Acto I, escena IV
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);
Primero verifica si el módulo de la división por 4 es 0, luego continúa como la misma escena que antes, para Jazz
.
Acto I, escena 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;
Funciona como las dos anteriores, verificando si el módulo de la división por 5 devuelve 0, luego intenta escribir Buzz
; la única diferencia es que, al final, nos saltamos una escena.
Acto I, escena VI
System.out.print(Lady Capulet);
Para llegar a esta escena, el número asumido por Lady Capulet no debe haber sido ni Fizz ni Jazz ni Buzz; entonces, lo sacamos en forma numérica.
Acto I, escena 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;
Entonces, esta es la única forma en que encontré para saltar a la siguiente línea: salida, primero, un CR, luego un LF; luego, volvemos a la escena II, a la que podemos continuar con el programa.
Acto I, escena VIII
End.
Lo suficientemente directo.
Todavía estoy tratando de ver si puedo mostrar esto ejecutándose en línea, pero no puedo encontrar un compilador en línea: el que conozco no parece combinar bien con ningún programa, excepto el que ya está cargado, o tal vez hay algún tipo de problema con la interfaz entre el teclado y la silla ...
Actualización 1:
Después del comentario de Mathmandan, edité el orden de las escenas de Jazz y Buzz. Que se tenía que hacer.