Javascript
function stringTheory(theory) {
var proof = 0;
var principles = theory.split(/[ ,.'-]/);
for (var i = 0; i < principles.length; i++) {
var formula = '';
for (var j = 0; j < principles[i].length; j++) {
formula += principles[i].charCodeAt(j).toString(10);
}
proof += +formula;
}
return proof;
}
console.log(
/* \2 and \3 are start of text and end of text characters */
stringTheory('\2 Yo it\'s 4327 - Go to space, look back, and see the dot of a small blue rock you once sat on amid the vast empty void - KA-BOOM - you are in awe of it. "Ah" - so tiny in this vast space yet you are even more so. A mere atom in an ocean of stars, the earth a speck of dust to the sun\'s ping-pong ball. One day you shall go back and as your toes touch the soft soil once more, the cool wind in your hair as you cast your gaze upon the moon, a mere rock just like this one, and bask in it\'s warm glow - Ah. Only then can you know the scale of it all, what luck you have to call this place home. And with this new ken, a love you\'ve kept for all of time but had not seen - for it is clear to you now. You lay open your arms and fill the air with your song - (aah) ~o Good-bye space and ... o? \3') + 42
);
O que está acontecendo?
Pegamos essa string e aplicamos um pouco stringTheory()
(na verdade, é uma transmissão do futuro):
'\2 Yo it\'s 4327 - Go to space, look back, and see the dot of a small blue rock you once sat on amid the vast empty void - KA-BOOM - you are in awe of it. "Ah" - so tiny in this vast space yet you are even more so. A mere atom in an ocean of stars, the earth a speck of dust to the sun\'s ping-pong ball. One day you shall go back and as your toes touch the soft soil once more, the cool wind in your hair as you cast your gaze upon the moon, a mere rock just like this one, and bask in it\'s warm glow - Ah. Only then can you know the scale of it all, what luck you have to call this place home. And with this new ken, a love you\'ve kept for all of time but had not seen - for it is clear to you now. You lay open your arms and fill the air with your song - (aah) ~o Good-bye space and ... o? \3'
Primeiro, dividimos na pontuação para formar palavras. Em seguida, criamos um conjunto de números convertendo os caracteres em seu código ASCII decimal. As letras anexas tornam-se números adjacentes (por exemplo, aa
tornam-se 9797
).
Os números são então somados. O que recuperamos é 191212222216169
um número totalmente inútil, que não tem significado, como os quatrilhões de rochas que flutuam ociosamente no espaço. O que torna este mundo especial? Por que isso é vida? Então, dando a esse número o significado da vida, +=42
então obtemos 191212222216211
;
Mas por que?
O que isto significa? Por que isso significa, é stringTheory("Hello world")
claro.