Be the first to rate this file! 198 downloads (last 30 days) File Size: 21.76 KB File ID: #21211

Minesweeper Game

by Dahua Lin

 

25 Aug 2008 (Updated 26 Aug 2008)

No BSD License  

A minesweeper game similar to the one in Windows, but implemented in pure MATLAB

Download Now | Watch this File

File Information
Description

Consider playing minesweeper in Matlab? Here's what you might want to look at.

I implement a minesweeper game with pure MatLab language. It basically imitates the minesweeper in Microsoft Windows. You can open a cell by left clicking and tag a cell as mine by right clicking. You can switch between three levels: beginner, intermediate, and advanced. There's also a timer to measure the time that you take to complete the game.

The usage is very simple. Copy the m-file (there's only one m-file) to anywhere that you like. Just type in

minesweepgame;

then you can start the game. Or you can type in

minesweepgame beginner;
minesweepgame intermediate;
minesweepgame advanced;

to start a game at desired level. You can also switch between different levels in the GUI.

In addition, you can also play a customized game, i.e. when you enter

minesweepgame(20, 25, 50);

you start a game with 50 mines in a 20 x 25 field.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
26 Aug 2008 Rodney Thomson

It appears to require the Statistics Toolbox (Undefined function or method 'randsample')

26 Aug 2008 Duane Hanselman

MATLAB ships with its own minesweeper demo program as well: xpbombs

Please login to add a comment or rating.
Updates
26 Aug 2008

make a minor fix to the description.

Tag Activity for this File
Tag Applied By Date/Time
games Dahua Lin 22 Oct 2008 10:15:59
minesweeper Dahua Lin 22 Oct 2008 10:15:59
game Dahua Lin 22 Oct 2008 10:15:59
mine Dahua Lin 22 Oct 2008 10:15:59
sweeper Dahua Lin 22 Oct 2008 10:15:59
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com