Simple minesweeper in Rust based on piston_window
To win the game - open all cells with numbers.
Controls:
R
- restartH
- field height setupW
- field width setupM
- mines quantity setupArrows
to choose cell (or change settings in setup
mode)Space
to open cellCtrl
to mark cellEsc
to exitLMB
click on a cell to openRMB
click on a cell to markNOTE: marked cells disallow opennig them, until mark will be removed.
NOTE: pressing Space
or LMB
on opened cell will open it's neighbors (Thanks to waynenilsen and xilec!)
In game screenshot (green cells are marked) NOTE: you can see counter of marked cells at the right of the window
Defeat (red cells are missed mines)
NOTE: with *
marked mines which ended the game
minesweeper
is licensed under the MIT license. Please read the LICENSE file in this repository for more information.
Follow these instructions to compile minesweeper-rs
.
$ git clone https://github.com/Vinatorul/minesweeper-rs && cd minesweeper-rs
$ cargo build --release
(NOTE: There is a large performance differnce when compiling without optimizations, so I recommend alwasy using --release
to enable to them)target/release/minesweeper
Pass -h
to arguments or look here:
USAGE:
minesweeper [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
--oldOGL set OpenGL version to 2.1
-V, --version Prints version information
OPTIONS:
-f, --field <field> field size "width"x"height"
--maxFPS <max_fps> set max fps
-m, --mines <mines> max mines
-s, --size <size> window size "width"x"height"
Contributions are always welcome! Please use the following guidelines when contributing to minesweeper
minesweeper
git clone https://github.com/$YOUR_USERNAME/minesweeper-rs && cd minesweeper-rs
)git checkout -b new-branch
)git commit -am "your message"
)
imp
, wip
, gr
.TYPE(COMPONENT): MESSAGE
where TYPE
is one of the following:feat
- A new featureimp
- An improvement to an existing featureperf
- A performance improvementtests
- Changes to the testing framework or tests onlyfix
- A bug fixrefactor
- Code functionality doesn't change, but underlying structure maystyle
- Stylistic changes only, no functionality changeswip
- A work in progress commit (Should typically be git rebase
'ed away)chore
- Catch all or things that have to do with the build system, etcgr
- Graphics changesCOMPONENT
is optional, and may be a single file, directory, or logical component. Can be omitted if commit applies globallycargo test
)git rebase
into concise commits and remove --fixup
s (git rebase -i HEAD~NUM
where NUM
is number of commits back)git push origin $your-branch
)