Question: I need help with the following question (15 Puzzle) Write a web page that enables the user to play the game of 15. Theres a
I need help with the following question
(15 Puzzle) Write a web page that enables the user to play the game of 15. Theres a 4-by- 4 board (implemented as an HTML5 table) for a total of 16 slots. One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered from 1 through 15. Any tile next to the
currently empty slot can be moved into the currently empty slot by clicking on the tile. Your pro- gram should create the board with the tiles out of order. The users goal is to arrange the tiles in
sequential order row by row. Using the DOM and the click event, write a script that allows the user to swap the positions of the open position and an adjacent tile. [Hint: The click event should be specified for each table cell.]
I need this written in javascript
please help thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
