~bsprague/chaos

69b9704ed756c64331f5668a11e398775525db30 — Brandon Sprague 2 months ago e4928b7
Clippy
1 files changed, 3 insertions(+), 2 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +3 -2
@@ 9,7 9,7 @@ fn main() -> Result<(), PlayError> {
    // Play a 100000 random games
    for _ in 0..100000 {
        let mut b = Board::new();
        while let None = b.winner() {
        while b.winner().is_none() {
            let m = Move {
                x: rng.gen_range(0..=MAX_DIM),
                y: rng.gen_range(0..=MAX_DIM),


@@ 43,6 43,7 @@ const BOARD_SIZE: usize = 3;
const MAX_DIM: u8 = (BOARD_SIZE as u8) - 1;

#[derive(Debug)]
#[allow(dead_code)] // The Internal(String) is for debugging
enum PlayError {
    MoveOutOfBounds,
    Internal(String),


@@ 152,6 153,6 @@ impl Board {
                return Some(player.clone());
            }
        }
        return None;
        None
    }
}