CodePen

HTML

            
              
            
          
!
via HTML Inspector

CSS

            
              
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              function Start () {
    if (state == 'stopped') {
        state = 'running';
        Process_Queue ();  // get the queue going again
    }
}

function Stop () {
    state = 'stopped';
}
    
function Reset () {
    if (state == 'stopped') {
        Remove_Discs ();
        discs    = Create_Discs (number_of_discs);
        pins [0] = discs.slice (0);  // create a clone of the discs array
        pins [1] = new Array ();
        pins [2] = new Array ();
        Resize_To_Window ();
        delete queue;
        queue = new Array ();
        Move_Stack (pins [0].length, 0, 2, 1);  // fill up the move queue
    }
}

function Faster () {
    surface.Change_Duration (-50);
}

function Slower () {
    surface.Change_Duration (50);
}

function Add1 () {
    if (state == 'stopped') {
        if (number_of_discs < 10) {
            number_of_discs += 1;
        }
        Reset ();
    }
}

function Sub1 () {
    if (state == 'stopped') {
        if (number_of_discs > 2) {
            number_of_discs -= 1;
        }
        Reset ();
    }
}

            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................