fn select_start_player() -> Player {
        println!("Who would like to start?");
        println!("Press O or 1 for Player O");
        println!("Press X or 2 for Player X");
        loop {
            let mut play_again_buffer = String::new();
            std::io::stdin().read_line(&mut play_again_buffer).unwrap();
            match play_again_buffer.trim() {
                "O" | "o" | "1" => return Player::O,
                "X" | "x" | "2" => return Player::X,
                _ => {
                    println!("Sorry, please provide a valid selection.");
                    continue;
                }
            }
        }
    }
/// Allows the user to decide who starts the game.
Allows the user to decide who starts the game.
Allows the user to decide who starts the game .
fn select_start_player() -> Player {
        println!("Who would like to start?");
        println!("Press O or 1 for Player O");
        println!("Press X or 2 for Player X");
        loop {
            let mut play_again_buffer = String::new();
            std::io::stdin().read_line(&mut play_again_buffer).unwrap();
            match play_again_buffer.trim() {
                "O" | "o" | "1" => return Player::O,
                "X" | "x" | "2" => return Player::X,
                _ => {
                    println!("Sorry, please provide a valid selection.");
                    continue;
                }
            }
        }
    }
fn select_start_player ( ) -> Player { println ! ( " " ) ; println ! ( " " ) ; println ! ( " " ) ; loop { let mut play_again_buffer = String :: new ( ) ; std :: io :: stdin ( ) . read_line ( & mut play_again_buffer ) . unwrap ( ) ; match play_again_buffer . trim ( ) { " " | " " | " " => return Player :: O , " " | " " | " " => return Player :: X , _ => { println ! ( " " ) ; continue ; } } } }
Allows the user to decide who starts the game.
Allows the user to decide who starts the game .