1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Solitaire Card Game
//! ```
//! use games::solitaire::*;
//! let mut solitaire_game = Solitaire::new();
//! // Attempt to move a card from StockPile -> Tablue, Row 1
//! match solitaire_game.move_to(Area::Stockpile, Area::Tablue{row:1, amount: 1}) {
//! Ok(_) => (),
//! Err(SolitaireError::IllegalMovementError) => {solitaire_game.draw_card().ok();}, // Not a valid, lets draw a card
//! Err(SolitaireError::OutOfCardsError) => {return;} // Shouldn't be out of cards
//!
//! _ => unreachable!()
//! }
//! // View total moves made
//! println!("You have made {} moves", solitaire_game.moves());
//! // View the next card
//! match solitaire_game.peek() {
//! Ok(card) => println!("Your next card is {}", card),
//! Err(SolitaireError::OutOfRangeError) => println!("No more cards to peek at!"),
//! _ => unreachable!()
//!
//! }
//! // Check if the game is a win
//! if solitaire_game.game_won() {
//! println!("You win!")
//! } else {
//! println!("Don't give up yet!")
//! }
//!
//! ```
/// Solitaire Errors
pub
pub use SolitaireCard;
pub use *;
pub use *;