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
);
Que se passe-t-il?
On prend cette chaîne et on l'applique un peu stringTheory()
(c'est en fait une transmission du futur):
'\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'
Nous l'avons d'abord divisé à sa ponctuation pour former des mots. Nous créons ensuite un ensemble de nombres en convertissant les caractères en leur code ASCII décimal. Les lettres jointes deviennent des nombres joints (par exemple aa
devient 9797
).
Les nombres sont ensuite additionnés. Ce que nous récupérons est 191212222216169
un nombre totalement inutile, il n'a pas de sens, tout comme les quadrillions de roches qui flottent paresseusement dans l'espace. Qu'est-ce qui rend ce monde spécial? Pourquoi c'est la vie. Donc, en donnant à ce nombre le sens de la vie, +=42
nous obtenons 191212222216211
;
Mais pourquoi?
Qu'est-ce que ça veut dire? Pourquoi cela signifie stringTheory("Hello world")
bien sûr.