mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 20:34:32 -08:00
30 lines
477 B
Rust
30 lines
477 B
Rust
use crate::{
|
|
game::Game,
|
|
util::{prompt, PromptResult::*},
|
|
};
|
|
|
|
mod game;
|
|
mod util;
|
|
mod ai;
|
|
|
|
fn main() {
|
|
util::intro();
|
|
|
|
loop {
|
|
let mut game = Game::new();
|
|
|
|
loop {
|
|
if !game.update() {
|
|
break;
|
|
}
|
|
}
|
|
|
|
if let YesNo(y) = prompt(Some(false), "\nANYONE ELSE CARE TO TRY?") {
|
|
if !y {
|
|
println!("OK --- THANKS AGAIN.");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|