Implement a Useless interpreter
HTML + Javascript + jQuery + jQuery UI

The input should be given in the text area and should be formatted as each command in a line. The commands are not case sensitive. All of the commands were fully implemented. I hope that you enjoy.

You can try it at http://jsfiddle.net/bCBfk/

&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" &gt;
    &lt;title&gt;Useless interpreter&lt;/title&gt;
    &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"&gt;
    &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
    &lt;script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"&gt;&lt;/script&gt;
    &lt;style type="text/css"&gt;
      textarea { height: auto; }
      .badshit { color: red; }
      .ui-dialog-titlebar-close { display: none; }
    &lt;/style&gt;
    &lt;script type="text/javascript"&gt;
      String.prototype.startsWith = function(x) {
        return this.substring(0, x.length) === x;
      };
      String.prototype.endsWith = function(x) {
        return this.substr(this.length - x.length, x.length) === x;
      };

      var npe = "&lt;pre&gt;java.lang.NullPointerException\n"
          + "       at org.esolangs.wiki.useless.memorymodel.ExistentObjectPool.findObject(ExistentObjectPool.java:684)\n"
          + "       at org.esolangs.wiki.useless.interpreter.WhereInstruction.visit(WhereInstruction.java:29)\n"
          + "       at org.esolangs.wiki.useless.interpreter.UselessProgram.run(UselessProgram.java:413)\n"
          + "       at org.esolangs.wiki.useless.interpreter.Main.main(Main.java:53)&lt;/pre&gt;";

      var wut = navigator.userAgent + " - " + navigator.language + " - " + navigator.platform + " - Ii?".toLocaleUpperCase();

      var wut2 = "";
      for (var c = wut.length - 1; c &gt;= 0; c--) {
          wut2 += wut.charAt(c);
      }

      var popupMasterMind;
      function killIt() {
        clearInterval(popupMasterMind);
        $(".dontuseme").remove();
        popupMasterMind = null;
      }

      function spawn() {
        var x = $("&lt;div class='dontuseme' title=''&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;");
        $("body").append(x);
        x.dialog();
        var bw = $("body").innerWidth();
        var bh = $("body").innerHeight();
        if (bh &lt; 500) bh = 500;
        var xw = x.width();
        var xh = x.height();
        x.parent().css({left: Math.random() * (bw - xw) + "px", top: Math.random() * (bh - xh) + "px"});
      }

      function dontuseme() {
        if (popupMasterMind) return;
        spawn();
        popupMasterMind = setInterval(spawn, 700);
      }

      var hasOutput = false;
      function clearOutput() {
        $("#output").empty();
        hasOutput = false;
        $("#cc").hide();
      }

      function out(a) {
        $("#output").append($(a));
        hasOutput = true;
      }

      function finish() {
        $("#running").hide();
        $("#bt").show();
        if (hasOutput) $("#cc").show();
      }

      var annoyingUser = false;
      function swap() {
        annoyingUser = true;
        $("#everything").toggle();
        setTimeout(swap, 800);
      }

      function randomString() {
        var r = "";
        var f = Math.floor(Math.random() * 12) + 8;
        for (var i = 0; i &lt; f; i++) {
          r += "ABCDEFGHIJKLMNOPQRSTUVWXYZ.!?0123456789".charAt(Math.floor(Math.random() * 39));
        }
        return r;
      }

      var instructions;
      function includeInstruction(name) {
        name = name.toUpperCase();
        if (instructions[name]) return; // Do not add it twice or overwrite existing instructions.
        var array = [];
        for (var e in instructions) {
          array.push(e);
        }
        var rand = Math.floor(Math.random() * array.length);
        //alert(name + ": " + array[rand]);
        instructions[name] = instructions[array[rand]];
      }

      // DONTUSEME(n) are special cases handled elsewhere.
      instructions = {
        "FAIL": function() { out("&lt;p class='badshit'&gt;Warning: The &amp;lt;blink&amp;gt; tag is obsolete.&lt;/p&gt;"); if (!annoyingUser) swap(); return "next"; },
        "NOT": function() { out("&lt;p class='badshit'&gt;Warning: The NOT instruction is discouraged because it breaks yor Useless program.&lt;/p&gt;"); return "quit"; },
        "NEVER": function() { out("&lt;pre&gt;Wild MISSINGNO. appeared!&lt;/pre&gt;"); return "next"; },
        "IDK": function() { out("&lt;pre&gt;" + {}.idk + "&lt;/pre&gt;"); return "next"; },
        "BOOM!": function() { $("#everything").empty(); return "quit"; },
        "KABOOM!": function() { window.location = "http://answers.yahoo.com/question/index?qid=20110816062515AANqygl"; return "quit"; },
        "NO.": function() { finish(); return "quit"; },
        "QWAOZAPWQFUOA": function() { out("&lt;p class='badshit'&gt;Sorry, I could not understand &lt;a href='https://www.google.com.br/#q=women+psychology+and+behaviour'&gt;this&lt;/a&gt;.&lt;/p&gt;"); return "next"; },
        "WUT?": function() { out("&lt;p&gt;" + wut2 + "&lt;/p&gt;"); return "next"; },
        "WHERE?": function() { out(npe); return "next"; },
        "HOW?": function() { out("&lt;p class='badshit'&gt;Regular expression parser failed for HTML. Cause: \"ZALGO\"&lt;/p&gt;"); return "next"; },
        "ILLEGAL": function() { out("&lt;pre&gt;codegolfer is not in the sudoers file.  This incident will be reported&lt;/pre&gt;"); return "next"; },
        "GODEXISTS": function() { out("&lt;p&gt;'GOD' spelled backwards is 'DOG'. A DOG is an animal that does not exists, and by backwarding this, we conclude that GOD exists and is not an animal.&lt;/p&gt;"); return "next"; },
        "WINDOWS": function() { out("&lt;p&gt;&lt;img width='640' height='400' src='http://upload.wikimedia.org/wikipedia/commons/3/3b/Windows_9X_BSOD.png' alt='Sorry, this optional instruction was not implemented. Please, install the service pack.'&gt;&lt;/p&gt;"); return "next"; },
        "NOOP": function() { return "next"; },
        "TURINGVSALONZO": function() {
          var r = Math.random() * 10;
          if (r &lt; 2) return "next";
          if (r &lt; 7) return "t" + (Math.random() * 14 + 1) * 1000;
          if (r &lt; 9) return "t" + (Math.random() * 50 + 10) * 60 * 1000;
          return "quit";
        },
        "42": function() {
          out("&lt;p&gt;Calculating the answer of the life, the universe and everything.&lt;/p&gt;");
          out("&lt;p&gt;Estimated time is 7.5 million years.&lt;/p&gt;");
          out("&lt;p&gt;Don't you want to briefly take a coffe while you wait? It will not take long, I promise.&lt;/p&gt;");
          return "quit";
        },

        // This is special, as it needs a (surprising) useless parameter, it can't be acessed directly without prior processing, this is why it is lowercase.
        "dontuseme": function() { dontuseme(); return "next"; },

        // This is special. If the INCLUDE-xxx generates a INCLUDE-yyy instruction, the yyy instruction will have an unknown random generated name.
        // Since yyy is random and unknown, it probably won't appear in the input source code, but implement it regardless.
        "include-random": function() { includeInstruction(randomString()); return "next"; }
      };

      function bad(line) {
        //alert(line);
        out("&lt;p class='badshit'&gt;Syntax error: &lt;/p&gt;");
      }

      function beyondEnd() {
        out("&lt;p class='badshit'&gt;Unrecoverable error: Tried to execute code beyond the end or program.&lt;/p&gt;");
      }

      function interpretInstruction(lines, idx) {
        if (idx &gt;= lines.length) { beyondEnd(); return; }

        // The toUpperCase serves two purposes: Making the language case-insensitive and hiding private implementations as lowercase instructions.
        ins = lines[idx].trim().toUpperCase();

        var result;

        // Special handling for parsing DONTUSEME(n)
        if (ins.startsWith("DONTUSEME(") &amp;&amp; ins.endsWith(")")) {
          try {
            parseInt(ins.substring("DONTUSEME(".length, ins.length - 1));
          } catch (e) {
            bad(ins);
            return;
          }
          ins = "dontuseme";

        // Special handling for INCLUDE-xxx
        } else if (ins.startsWith("INCLUDE-") &amp;&amp; ins.length &gt; 8) {
          var name = ins.substring(8);
          includeInstruction(name);
          ins = "NOOP"; // Already executed, follow-up as noop.
        }

        // Execute the instruction.
        var f = instructions[ins];
        if (!f) { bad(ins); return; }
        var result = f();

        // Move on.
        if (result === "quit") return;
        var toWait = result === "next" ? 0 : parseInt(result.substring(1));
        var ii = idx + 1;
        setTimeout(function() {
          interpretInstruction(lines, ii);
        }, toWait);
      }

      function startInterpreter() {
        $("#bt").hide();
        $("#cc").hide();
        $("#running").show();
        var src = $("#input").val();
        var lines = src.split('\n');
        interpretInstruction(lines, 0);
      }

      $(document).ready(function() {
        $("#bt").click(startInterpreter);
        $("#cc").click(clearOutput);
      });
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id="everything"&gt;
      &lt;p&gt;Type here your program input:&lt;/p&gt;
      &lt;textarea id="input" style="width: 400px; height: 150px;"&gt;&lt;/textarea&gt;
      &lt;p&gt;
        &lt;button id="bt"&gt;Run the program&lt;/button&gt;
        &lt;span id="running" style="display: none;"&gt;Running the program...&lt;/span&gt;
      &lt;/p&gt;
      &lt;p&gt;Here is the program output:&lt;/p&gt;
      &lt;p id="output" class="useless"&gt;&lt;/p&gt;
      &lt;button id="cc" style="display: none;"&gt;Clear the output&lt;/button&gt;
    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;


It has one new command:


   It is the 42 command which calculates the answer of the life, the universe and everything. The only quirk is that it takes 7.5 million years to finish.


Other spoilers:


   This entry has several features:
 
  You will really hate the FAIL command.
  BOOM! will screw up you "execution unit". At least the windows from DONTUSEME(n) are able to survive this.
  KABOOM! is really dangerous to world in several bad ways.
  DONTUSEME(n) always opens infinite unclosable empty windows, one each 0.8 seconds. But there is a hidden kill switch.
  DONTUSEME(n) survives NO., FAIL and even BOOM!. I just couldn't make it survive the KABOOM! though. The reason is that popup windows won't work as this is not the result of a click (and popups created by other ways are long banned in all major browsers), and could not use iframes too because of a violation of same-origin policy.
  INCLUDE-xxx can create any instruction, including DONTUSEME(n) or another INCLUDE-yyy instruction.
  If INCLUDE-xxx does generates an INCLUDE-yyy instruction, the yyy name is generated at random. If you grab the name of the generated command with firebug or something similar, you can use it.
  It handles malformed syntax and incomplete or empty input.