6-342-30-2-132 / 420-72-30 /
12-240-20-30 / 420-240 /
342-30-506-30-2-156 / 2 /
42-2-182-240-462-380 /
272-72-342-2-380-30 / 2-210-20 /
90-420-380 / 2-462-420-72-240-342:
420-240 / 6-30 / 240-342 /
210-240-420 / 420-240 / 6-30;
420-72-2-420 / 90-380 / 420-72-30 /
306-462-30-380-420-90-240-210.
~552-90-156-156-90-2-182 /
380-72-2-132-30-380-272-30-2-342-30
Note: Each letter of every word is separated by a dash and each word is separated by a slash.
Each letter in the original message was replaced by its index multiplied by one more than the index (the nth letter is replaced by n(n+1)).
Here's a little script that reads the code and prints out the result. I modified it slightly, simply replacing the dashes with spaces and using the spaces to delimit sections to be parsed. The line breaks were not present in the original code; I added them just so they would fit on this page. vals[] is an array that contains the translated letters at their indexed positions (vals[2]='a', vals[30]='e', etc.). That seemed easier than trying to do the math backwards.
var letters = "abcdefghijklmnopqrstuvwxyz";
var vals = new Array();
for (var i = 1; i <= 26; i++) {
var n = i*(i+1);
vals[n] = letters.charAt(i-1);
}
function parseCode(val) {
if (val == "/")
return " ";
else if (isInteger(val))
return vals[code[i]];
else
return " " + val + " ";
}
function isInteger(val){
var string="1234567890";
for(var i = 0; i < val.length; i++)
if(string.indexOf(val.charAt(i)) == -1)
return false;
return true;
}
var code = "6 342 30 2 132 / 420 72 30 / 12 240 20 30 / 420 240 / ";
code += "342 30 506 30 2 156 / 2 / 42 2 182 240 462 380 / 272 72 3";
code += "42 2 380 30 / 2 210 20 / 90 420 380 / 2 462 420 72 240 34";
code += "2 : 420 240 / 6 30 / 240 342 / 210 240 420 / 420 240 / 6 ";
code += "30 ; 420 72 2 420 / 90 380 / 420 72 30 / 306 462 30 380 4";
code += "20 90 240 210 . ~ 552 90 156 156 90 2 182 / 380 72 2 132 ";
code += "30 380 272 30 2 342 30".split(" ");
var result = "";
for (var i = 0; i < code.length; i++) {
result += parseCode(code[i]);
}
document.write(result);
When run, this code outputs:
break the code to reveal a famous phrase and its author :
to be or not to be ; that is the question . ~ william shakespeare
|
Posted by DJ
on 2004-03-16 13:33:31 |