Question: Write a web page that enables the user to play the game of 15. 1.There is a 4-by-4 board (implemented as an XHTML table) for
Write a web page that enables the user to play the game of 15.
1.There is a 4-by-4 board (implemented as an XHTML table) for a total of 16 slots.
2.One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered from 1 through 15.
3.Any tile next to the currently empty slot can be moved into the currently empty slot by clicking on the tile.
4.Your program should create the board with the tiles out of order.
5. The user's goal is to arrange the tiles in sequencial order row by row.
6.Using the DOM and the onclick event, write a script that allows the user to swap the positions of the open position and an adjacent tile. [Hint: The onclick event should be specified for each table cell.]
Code must be able to be used with notepad with no editing and must meet each of the requirements. Do not just copy and paste from the already available code on the internet, it doesnt work properly.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
