JSFiddle

  • Potential Field pathing algorithm #7 is the latest revision

    No-Library (pure JS), HTML, CSS, JavaScript

    var
        attraction = [ 25, 28 ]
        , canvas = document.querySelector( "#canvas" )
        , map = [
            [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ...
  • Imperfect "Perfect Maze" Generator #23 is the latest revision

    A Javascript "perfect maze" generator that has its quirks

    // declare our main maze object
    var maze =
    {
        cells: []
        , div: document.querySelector( "#maze" )
        , height: 0
        , width: 0
    };
    
    createCells();
    createMaze();
    
    // function to ...
  • document.write alternative #90 is the latest revision

    A way to insert content "inline" without using document.write

    <!doctype html>
    <html>
        <head>
            <title>document.write alternative</title>
            <meta charset="utf-8"/>
        </head>
        <body>
            <p>Here is some content.</p>
            <!-- load a script; any script -->
            <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
            <!-- here's our document.write analog; could just as easily be a remote file -->
            <script type="text/javascript">
                // get the "last" script on the page
                var s = document.getElementsByTagName('script');
                s ...</script></!--></!--></body></html></!doctype>
  • Whack-A-Moo #16 is the latest revision

    A Javascript Whack-a-Mole game for Moo Challenge #2

    // @haliphax
    
    document.querySelector("#start").onclick = function()
    {
        var
            WIDTH = Math.max(prompt("Width in cells", 15) | 0, 5)
            , HEIGHT = Math.max ...