Puzzle Game Example
let puzzleTiles = [
"tile1.jpg",
"tile2.jpg",
"tile3.jpg",
"tile4.jpg",
"tile5.jpg",
"tile6.jpg",
"tile7.jpg",
"tile8.jpg",
"tile9.jpg"
];function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
let j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
shuffle(puzzleTiles);Last updated