A Javascript library that creates animated output that looks like code, but isn't really.

It randomly generates code sequences using several base blocks (flow control, variable definition, execution statements, and SQL queries). Good for if you ever need output that looks code-y, but is actually nonsense!

See it in action Download CodeSimulator.js View on Github


Include Prototype.js and CodeSimulator, then do:

<script src=""></script>
<script src="CodeSimulator.js"></script>

// The DOM element we want to output code to
var code = $("code");

var simulator = new CodeSimulator({output: code});

Notes & caveats

There are a few things to know about this library:

  • CodeSimulator doesn't generate real code.
  • CodeSimulator mixes up syntax from lots of different languages.

Download CodeSimulator.js View on Github


Found a bug? Got a question? Or just want to say hello? Find me on Twitter as @craigmunro.