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
39
40
41
42
43
44
45
46
//! The rules of four in a row.
//!
//! [`GameState`] holds a valid position: a board, the player to move and the current
//! [`Status`]. [`Game`] wraps a state together with the moves that produced it.
//!
//! Moves are made by column. Columns are numbered from zero and left to right, rows are numbered
//! from zero and bottom to top.
//!
//! # Examples
//!
//! ```
//! use fours::game::Cell;
//! use fours::game::GameState;
//! use fours::game::Player;
//!
//! let mut state = GameState::new();
//! let placement = state.apply_move(0).unwrap();
//!
//! assert_eq!(placement.player, Player::Red);
//! assert_eq!(placement.cell, Cell::new(0, 0));
//! assert_eq!(state.current_player(), Player::Yellow);
//! ```
pub use BoardDimensions;
pub use MAXIMUM_SIDE;
pub use MINIMUM_SIDE;
pub use Cell;
pub use GameError;
pub use GameState;
pub use Placement;
pub use Player;
pub use Game;
pub use Status;
pub use Victory;
/// The number of discs a player has to line up in order to win.
pub const LINE_LENGTH: usize = 4;