chessnut 0.0.1

Rust driver for Chessnut electronic chess boards
Documentation
use crate::{Set, Square};

pub struct Squares;

impl Squares {
    pub fn all() -> Set<Square> {
        (0..).take(64).map(Square::new).collect()
    }

    pub fn dark() -> Set<Square> {
        (0..64).map(Square::new).filter(|square| square.is_dark()).collect()
    }

    pub fn none() -> Set<Square> {
        Default::default()
    }

    pub fn light() -> Set<Square> {
        (0..64).map(Square::new).filter(|square| square.is_light()).collect()
    }
}