View Full Version : [DHTML] Minesweeper

03-29-2007, 03:30 PM
1) CODE TITLE: Minesweeper

2) AUTHOR NAME/NOTES: Michael Burt (http://mburt.funpic.org)

3) DESCRIPTION: This is a simple game with a 13*13 grid, where you click on the quares. A random 35 (or any number you choose) squares will be placed on the grid, and if you click on them, boom, the mine explodes, the game is over :).

4) URL TO CODE: http://mburt.funpic.org/projects/minesweeper/code.php
URL TO DEMO: http://mburt.funpic.org/projects/minesweeper

03-29-2007, 05:43 PM
Nice, but in a the real "Minesweeper" there are numbers on opened squares that indicate number of bombs around that square.

03-29-2007, 09:25 PM
Point taken... I'm not really sure how I would implement that effect... seems fairly complex.

03-29-2007, 10:02 PM
Doesn't really work very well... at least in Konqueror.

03-30-2007, 02:59 AM
Doing the numbers is necessary.
Works fine in FF, but the lack of numbers makes it no fun.

Here's how to do numbers--
Use a grid setup and then check if the surrounding boxes are mines; if so, then add one to the number for that square. After all surrounding boxes are checked, then display the number. The end.

04-09-2007, 03:21 AM
also how about giving the user an option of how many mines to place ? if this is in javascript could just do a prompt dialog then convert it to a number and go from there

04-09-2007, 10:16 AM
Start by figuring out the numbers, then adding in a user-based number of mines shouldn't be too difficult. And user-chosen size of the grid after that.

04-09-2007, 12:57 PM
I'll try to work on the updgrades... I don't really know where to start, but I'll try.