fours 0.1.0

Four in a row in your terminal, with three levels of opponent.
Documentation
use crate::game::MAXIMUM_SIDE;
use crate::game::MINIMUM_SIDE;
use thiserror::Error;

/// The reason a game rejected a move or a board configuration.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Error)]
#[non_exhaustive]
pub enum GameError {
    /// The requested column is outside the board.
    #[error("column {column} does not exist, the board has {column_count} columns")]
    ColumnOutOfRange { column: usize, column_count: usize },

    /// The requested column has no room for another disc.
    #[error("column {column} is full")]
    ColumnFull { column: usize },

    /// The game already ended, so no further move can be made.
    #[error("the game is already over")]
    GameOver,

    /// The requested board size cannot be played on.
    #[error(
        "a board must have between {MINIMUM_SIDE} and {MAXIMUM_SIDE} columns and rows, \
         got {column_count} columns and {row_count} rows"
    )]
    InvalidDimensions {
        column_count: usize,
        row_count: usize,
    },

    /// The board rejected an operation that the rules considered valid.
    ///
    /// This means the game and its board disagree about the state of the world and should not
    /// happen during normal play.
    #[error("the board rejected a valid move: {reason}")]
    Board { reason: String },
}