http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Computer Programming \ My Minesweeper Program

Click here to log in (you must be logged in to post comments).

AuthorComment
Vectris
Ultralisk
avatar
Posted: 23 Apr 2009
20:05 GMT
Total Posts: 375
Here's a project I finished a few weeks ago that I've been meaning to share. It's the same as the Microsoft Minesweeper although you can customize the colors (and it's a bit slower to load =P).

If anyone wants to test it out and see if there's any bugs I'd appreciate it.

Download

*Fixed Bugs
Setting too many mines in Custom mode
Mines never appearing in far right column and bottom row
Xphoenix
Ultralisk
avatar
Posted: 24 Apr 2009
22:12 GMT
Total Posts: 210
From the default size (10 by 10), 90 mines makes it crash ._.

---
~Xphoenix
Vectris
Ultralisk
avatar
Posted: 25 Apr 2009
20:52 GMT
Total Posts: 375
I see, its 82 and above for me. I also notice that at 80, there are never any mines in the far right column or bottom row, do you have that?
Xphoenix
Ultralisk
avatar
Posted: 26 Apr 2009
13:57 GMT
Total Posts: 210
Yeah. For both parts.

---
~Xphoenix
Vectris
Ultralisk
avatar
Posted: 26 Apr 2009
16:44 GMT
Total Posts: 375
I haven't tested it yet but I think I got it.

In VB.Net when setting the range for Rand(X,Y) where x is lowest and y is highest, y is actually excluded, so Rand(1,11) would actually be a random integer from 1 to 10.

To place my mines I randomly assign them an x and y corridnate within the custom width/length, however I forgot to add 1 to the variables so the mines never get in the last row or column. Then, because mines can't reach that far, they fill up every available space in the 9x9 area causing an error because the program can't find any empty spaces to put the rest of the mines in.





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org