Moving on from Hello World to Hello Caractacus

Java Humor and Lyrical Code Parody

A comedic remix of Java humor and lyrical code parody — weaving beginner satire, song structure in code, and object-oriented absurdity with britches, witches, and powdered recursion. Expect verses in camelCase, rhymes in semicolons, and a chorus of “public static void main” sung by enchanted compilers. It’s Shakespeare meets Stack Overflow, with a runtime of pure nonsense.

A “Hello world” program is a computer program that outputs “Hello, world” on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language. ~ Wikipedia

An example using the Java programming language looks like

// Hello World in Java 
public class HelloWorld { 

  static public void main( String args[] ) { 
    System.out.println( "Hello World!" );
  }
}

Again, all this program does is output “Hello World” to the screen.

A slightly more complex programming task for the beginner would be a “Hello Caractacus” program. The goal of this program is to output the lyrics to Rolf Harris’ deeply philosophical song “The Court of King Caractacus”. This task has more oomph to it because it requires the programmer to understand how the song builds upon itself.

Consider the following example (again in Java).

public class HelloCaractacus {
  public static final String TITLE = "the court of king caracticus by rolf harris";

  public static final String [] lyrics = {
    "the ladies of the harem of the court of king caractacus ",
    "the noses on the faces of ",
    "the boys who put the powder on ",
    "the fascinating witches who put the scintillating stiches in the britches of ",
  };
  public static final String[] BEGINNINGS = {
   "now ",
   "if you want to take a picture of "
  };
  public static final String[] ENDINGS = {
    "were just passing by.",
    "well it's too late! coz they've just passed by!"
  };
  public static final String[] COMMANDS = {
    "[all together]"
   };

  public static void main (String [] args) {
    jotln(TITLE);
    // for each verse
    for (int i=0;i<4;i++) {
      // repeat three times
      for (int j=0;j<4;j++) {
        if (j==1) {
          jotln(COMMANDS[0]);
        }
        jot(BEGINNINGS[0]); // now
        // join the appropriate bits together
        for (int k=i;k>=0;k--) {
          jot(lyrics[k]);
        }
        jotln(ENDINGS[0]); // were just passing by
      }
      jotln(""); // blank line
    }
    // photo opportunity
    for (int i=0;i<2;i++) {
      jot(BEGINNINGS[i]);
    }
    // the longest line
    for (int k=3;k>=0;k--) {
      jot(lyrics[k]);
    }
    jotln(ENDINGS[1]); // you are too late
  }

  public static void jot(String s)   { System.out.print(s); }   // for
  public static void jotln(String s) { System.out.println(s); } // brevity
}

This code snippet outputs the following…

the court of king caracticus by rolf harris
now the ladies of the harem of the court of king caractacus were just passing by.
(all together)
now the ladies of the harem of the court of king caractacus were just passing by.
now the ladies of the harem of the court of king caractacus were just passing by.
now the ladies of the harem of the court of king caractacus were just passing by.

now the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
(all together)
now the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.

now the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
(all together)
now the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.

now the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
(all together)
now the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.
now the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus were just passing by.

now if you want to take a picture of the fascinating witches who put the scintillating stiches in the britches of the boys who put the powder on the noses on the faces of the ladies of the harem of the court of king caractacus well it's too late! coz they've just passed by!

(Orignally published Thursday, February 21, 2008. Altered at whim.)

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights