Minesweeper

版本 1.0.0.0 (124.5 KB) 作者: Mihir Shah
A minesweeper game similar to the one in Windows, but implemented in pure MATLAB using GUIDE.
1.8K 次下载
更新时间 2010/7/17

查看许可证

Minesweeper is a simple one−player computer game commonly found on machines with popular operating systems such as Linux or Microsoft Windows. The object of the game is to clear an abstract minefield without detonating a mine.

The game consists of a 2 dimensional rectangular playing field (or board) where some known numbers of mines have been hidden. Initially, all of the squares on the board are "covered up" and no information is given to indicate the location of the mines. The player’s job is to either deduce or guess which board squares are clear of mines and step there to reveal a number. If successful, this number will indicate the number of mines to be found in the squares adjacent to the square with the number. Obviously, the first move of the game must be a guess because no information has been provided. Since the board is a rectangular grid, each interior square has exactly 8 neighbouring squares, edge squares have 5 neighbours, and corner squares have 3 neighbours. Therefore, the number found under any given square will be in the range of 0 to 8 (inclusive). Game play continues until the player has uncovered (or "stepped" on) each and every square that does not hide a mine, while successfully avoiding all of the mines. If the player can do this, they are considered to have won the game. However, if at any point the player attempts to uncover a square that contains a mine, the game immediately ends and the player is said to have lost.

Any suggestions and bug - fixes are welcome.

The code has been written using GUIDE.
I haven't tested this code on any other platform except R2009a (Matlab 7.8) so am not sure whether it will work for the previous versions of Matlab.

引用格式

Mihir Shah (2024). Minesweeper (https://www.mathworks.com/matlabcentral/fileexchange/28228-minesweeper), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Minesweeper 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Minesweeper/

版本 已发布 发行说明
1.0.0.0