Skip to content

uendicode/15PuzzleGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

15PuzzleGame

15 Puzzle Game using JavaScript

15 puzzle program consists on 4 by 4 board for a total of 16 slots. One of the slots is empty. The other slots are randomly numbered from 1 to 15. The user's goal is to arrange the tiles to order them in incremental manner. The program allows the user to swap the positions of the open position and an adjacent tile. A count up timer is displayed when the game is started. I have used Document Object Model (DOM) and click event to create this program.

When the game is finished the user is asked to play again or not. If he/she chooses to play again, numbers are scrambled using Math.random. Also each time the page is refeshed, numbers are selected randomly and the timer is displayed as well.

ImgName