Crate sweeprs

Source
Expand description

sweeprs is a minesweeper engine written in rust.

Example:

use sweeprs::{Board, BoardState, BoardResult};

let mut board = Board::new(9, 9, 10);
board.open(4, 4);
board.flag(0, 0);
match board.state() {
    BoardState::Playing => println!("Keep going!"),
    BoardState::Finished(BoardResult::Win) => println!("You win!").
    _ => (),
}

Structs§

Board
Default implementation of the SweeperBoard trait
Cell
Default cell struct

Enums§

BoardResult
BoardState
CellKind
Indicate what the mine contain
CellState
Hold the state of the cell
Error
General error type

Traits§

SweeperBoard
SweeperCell
Cell trait