Code covered by the BSD License  

Highlights from
Minesweeper Game

Be the first to rate this file! 31 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
game, games(2), mine, minesweeper, sweeper
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
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.

26 Aug 2008 Duane Hanselman

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

26 Aug 2008 Rodney Thomson

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

Updates
26 Aug 2008

make a minor fix to the description.

Contact us