Code covered by the BSD License  

Highlights from
Minesweeper Game

Be the first to rate this file! 12 Downloads (last 30 days) File Size: 6.75 KB File ID: #21211
image thumbnail

Minesweeper Game

by Dahua Lin

 

25 Aug 2008 (Updated 26 Aug 2008)

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

| 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 (3)
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

01 Feb 2010 long dan

can run the program,the error message is "??? Error: File: d:\MATLAB6p5\work\minesweepgame.m Line: 57 Column: 26
Expected a variable, function, or constant, found ")",who can tell me how to solve the problem.

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
sweeper Dahua Lin 22 Oct 2008 10:15:59
mine Dahua Lin 22 Oct 2008 10:15:59
games Daniel 05 Nov 2011 20:31:53

Contact us at files@mathworks.com