pub fn check_restart_game() -> bool {
    print!(
        "\n{} Do you want to restart? [Y/n]: ",
        "The game has ended!".magenta()
    );
    std::io::stdout().flush().unwrap();

    let mut response = String::new();
    io::stdin()
        .read_line(&mut response)
        .expect("Could not read end game response");

    match response.trim().to_lowercase().as_str() {
        "y" | "" => true,
        "n" => false,
        _ => false,
    }
}
/// Checks whether the user wants to restart the game or not.
Checks whether the user wants to restart the game or not.
Checks whether the user wants to restart the game or not .
pub fn check_restart_game() -> bool {
    print!(
        "\n{} Do you want to restart? [Y/n]: ",
        "The game has ended!".magenta()
    );
    std::io::stdout().flush().unwrap();
    let mut response = String::new();
    io::stdin()
        .read_line(&mut response)
        .expect("Could not read end game response");
    match response.trim().to_lowercase().as_str() {
        "y" | "" => true,
        "n" => false,
        _ => false,
    }
}
pub fn check_restart_game ( ) -> bool { print ! ( " \n " " " magenta ( ) ) ; std :: io :: stdout ( ) . flush ( ) . unwrap ( ) ; let mut response = String :: new ( ) ; io :: stdin ( ) . read_line ( & mut response ) . expect ( " " ) ; match response . trim ( ) . to_lowercase ( ) . as_str ( ) { " " | " " => true , " " => false , _ => false , } }
Checks whether the user wants to restart the game or not.
Checks whether the user wants to restart the game or not .