Caesars Box

Break the Caesars Box in ActionScript.

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");
 };
};


Don't like it? There are lots of published articles, pick a random one.

oCricket

Brajeshwar posted this article on Sat, Jul 31st, 2004 at 3:21 pm
Categorized under Technology and has the following tags

Prev Article: 128-10-93-85-10-128-98-112-6-6-25-126-39-1-68-78

Next Article: Magic Framerate


Possibly Related Articles

Archives: Visit the Archives for more articles.

Comments Post Yours

There are 5 responses so far. You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

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

  2. I have the normal Firefox 0.9.2!

  3. Dunno what happened, but now it’s fixed :)

  4. what is all this??? ahhh!

  1. Pings & Trackbacks Sites, articles & blog posts linking back to this article.

Post yours

Sidenotes

Quick notes, scribbles, somehow related to this website and to what I do. Or perhaps I'm just plain lazy to make them into a full article.

Fedora 10 Released

Let's talk history! Fedora was created in late 2003 as a Linux based Operating System which gives the users an admittance from anywhere in the world to the most up-to-date free and open source software ...28th Nov, 2008

Top 25 Hottest Indian Web Companies

Note: User submitted article. Personally, I would advise not to take this video seriously. 21st Nov, 2008

India gets ready for Free and Open Source Software

Over the years, FOSS.in has attracted thousands of participants, and the speaker roster reads like a "Who's Who" of FOSS contributors from across the world. FOSS.in is a non-commercial event organised and run entirely by FOSS ...21st Nov, 2008

Cooliris for the iPhone

Cooliris is the browser extension that revolutionizes the way you view media on your computer. It is now available as an application for your iPhone! Cooliris for the iPhone allows you to search the web ...22nd Oct, 2008

Adobe releases Flash Player 10 (Mac, Win & Linux)

Adobe have released the shipping version of Flash Player 10 for Mac, Windows and Linux. More about Flash Player 10 * About Flash Player 10 * Get Flash Player 10 (Official Release version 10.0.12.36) * Download Debug and Standalone ...15th Oct, 2008

View the Sidenotes Archive

Play the Penguin Game

Recommended

  • oCricket oCricket is about Cricket and people enthusiastic about it.
  • My Special Job My Special Job is a place where you can look for your weird necessities, strangely superb employees, when your need are more of those hackers, geeks, and ultimate rockstars in the Internet Technology.
  • Forum Oinam’s technical discussion forum where developers and designers can discuss all technical topics.
  • AS 2.0 Reference Reference for ActionScript 2.0 Programming Language used in Flash. Primarily stashed here for my own personal reference.
  • o! Just Me Of colorful cultures, entertainment, media, life hacks, music, books and movies from hollywood & bollywood.
  • Ode to Apple Dedicated to Apple - Mac, iPhone, iPod, iTunes, Quicktime, Apple TV and all the awesome softwares for the Apple Mac.
  • ActionScript 3.0 Reference Flash/Flex ActionScript 3.0 Reference.

Download free Brajeshwar Wordpress Theme

Brajeshwar

Brajeshwar I firmly believe in keeping things simple, easy for users and I envison pushing the technical envelop time and again for the betterment of viable commercial and practical applications. More about me.

Brajeshwar's affinity with Adobe

My Photos

More photos on Flickr

Member of 9rules Network

Since its inception on 11th June, 2001, "Brajeshwar" has 897 Articles and 6,106 comments, contained within 21 categories and 1,369 tags.