<--- --------------------------------------------------------------------------------------- ---- Blog Entry: jQuery Demo: Creating A Sliding Image Puzzle Plug-In Author: Ben Nadel / Kinky Solutions Link: http://www.bennadel.com/index.cfm?dax=blog:1009.view Date Posted: Oct 24, 2007 at 1:23 PM ---- --------------------------------------------------------------------------------------- ---> // In order to shuffle the board, we are going to simulate // a certain number of clicks. This is to ensure that any // state the board gets into, it is certain that the board // can get back into a "winning" state. for (intI = 0 ; intI < 100 ; intI++){ // Select the piece that we want to "click". // We will do this by randomly selecting a row // and a column to click. jPiece = arr2DBoard[ (Math.floor( Math.random() * intRows * intRows ) % intRows) ][ (Math.floor( Math.random() * intColumns * intColumns ) % intColumns) ]; // Simulate the click. jPiece.click(); }