turtle 1.0.0-rc.3

Learn the Rust language by creating animated drawings!
Documentation
use turtle::rand::Random;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Wall {
    Open,
    Closed,
}

impl Random for Wall {
    fn random() -> Self {
        if Random::random() {
            Wall::Open
        } else {
            Wall::Closed
        }
    }
}

impl Wall {
    pub fn is_closed(&self) -> bool {
        match *self {
            Wall::Open => false,
            Wall::Closed => true,
        }
    }
}