Download the new Autochrome 2.0 Photography Wordpress Theme.

Caesars Box

— By

Here is the ActionScript code to break the code
128-10-93-85-10-128-98-112-6-6-25-126-39-1-68-78.

function decodeCaesarsBox (sCode, sDelim, sDict) {
 var a = sCode.split (sDelim);
 var sBox = " ";
 var a2 = new Array ();
 var n = a.length;
 var iRoot = Math.sqrt (n);
 if (iRoot == Math.floor (iRoot)) {
  for (var i = 0; i < n; ++i) {
   sChar = sDict.charAt (Number (a [i])-1);
   sBox += sChar + "\t";
   if ((i+1)%iRoot == 0) {
    sBox += "\r ";           
   };
    a2.push (sChar);
  };   
 trace ("> Caesar's Box");
 trace (sBox);
 var a3 = new Array ();
 i = 0;
 var j = 0;
 while (a3.length != a2.length) {
  a3.push (a2 [i]);
  i += iRoot;           
  if (i >= a2.length) {
   i = ++j;
  };
 };
 trace ("> In Straight line");
 trace (a3.join (""));
 } else {
  trace ("Error, Caesar's box only works on perfect squares");
 };
};

Brajeshwar

Brajeshwar believes in simplicity; pushes the envelop and envisions the betterment of usable and practical solutions.

More by Brajeshwar

  • http://www.mr10.net Maarten van de Voorde

    ehr - Just so you know; in Firefox this post thoroughly messes up your layout.

  • http://www.mr10.net Maarten van de Voorde

    ehr - Just so you know; in Firefox this post thoroughly messes up your layout.

  • http://brajeshwar.com/ Brajeshwar

    I have the normal Firefox 0.9.2!

  • http://brajeshwar.com/ Brajeshwar

    I have the normal Firefox 0.9.2!

  • http://www.mr10.net Maarten van de Voorde

    Dunno what happened, but now it's fixed :)

  • http://www.mr10.net Maarten van de Voorde

    Dunno what happened, but now it's fixed :)

  • brigid

    what is all this??? ahhh!

  • Pingback: 128-10-93-85-10-128-98-112-6-6-25-126-39-1-68-78 - Brajeshwar