Struct sweeprs::Cell [−][src]
Expand description
Default cell struct
Fields
kind: CellKind
state: CellState
Trait Implementations
Create a new minesweeper board. height
and width
cannot be under 9,
while mine_count
cannot exceed height * width - 9
since the initial
cell and its neighbors must be a free cell. Return error if given invalid
configuration.
Open a cell, propagate if all neighboring cell is a free cell. Opening an opened cell will propagate if flagged cell count is equal to surrounding mine count.
Propagation is stopped when propagation reached a mine cell.
Flag a cell. Flagged cell cannot be opened until unflagged. Remove the flag by flagging a flagged cell again. Flagged cell counts toward opening an opened cell propagation.
Auto Trait Implementations
impl RefUnwindSafe for Cell
impl UnwindSafe for Cell
Blanket Implementations
Mutably borrows from an owned value. Read more