Add puzzle type.
This commit is contained in:
parent
c62c26aafd
commit
242dd19fca
@ -2,3 +2,7 @@
|
|||||||
//! The puzzle rules are expressed as constraints.
|
//! The puzzle rules are expressed as constraints.
|
||||||
|
|
||||||
extern crate bit_set;
|
extern crate bit_set;
|
||||||
|
|
||||||
|
pub use puzzle::Puzzle;
|
||||||
|
|
||||||
|
mod puzzle;
|
||||||
|
23
src/puzzle.rs
Normal file
23
src/puzzle.rs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
//! The puzzle's state and rules.
|
||||||
|
|
||||||
|
/// The puzzle to be solved.
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub struct Puzzle {
|
||||||
|
// The number of variables in the puzzle.
|
||||||
|
num_vars: usize,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Puzzle {
|
||||||
|
/// Allocate a new puzzle.
|
||||||
|
///
|
||||||
|
/// # Examples
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// puzzle_solver::Puzzle::new();
|
||||||
|
/// ```
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Puzzle {
|
||||||
|
num_vars: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user