Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Javascript

Name: Anonymous 2011-04-05 6:41

12.8 Write a web page that enables the user to play the game of 15. There is a 4- by-4 board for a total of 16 slots. One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered 1 through 15 (no duplicates of course). Any tile adjacent to the currently empty slot can be moved into it by clicking on the adjacent tile. Your application should create the board with the  row by row. Using the DOM and the onclick event write a script that allows the user to swap the position of the empty tile and an adjacent tile.
There is no need to detect for the end of the game and therefore no need to prompt for another game.
Hints

The board could be implemented as a table. No actual moving is necessary of course. A 2d array of td references may be useful. A 2d array of numbers may also be useful and efficient

Name: Autistic Duck 2011-04-05 6:43

Whats the point of playing the Game?

Name: Anonymous 2011-04-05 6:44

to get an HD of course

Name: Anonymous 2011-04-05 6:54

>>2
The article is supposed to be capitalized too.  It's The Game.

Name: Anonymous 2011-04-05 15:25

>>4
The article is supposed to be capitalized too. It's MY ANUS.

Don't change these.
Name: Email:
Entire Thread Thread List