You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.9 KiB
Rust

1 year ago
use kartsimrust::{
premade::{get_bandit, get_bob, get_george},
test_util::battle_stats::battle_stats,
};
fn main() {
env_logger::init();
let mut characters = vec![get_bob()];
let mut enemies = (0..1).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"Bob won {:.2}% of battles in an average of {:.1} turns.",
p, mu_t
);
characters = vec![get_george()];
enemies = (0..1).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"George won {:.2}% of battles in an average of {:.1} turns.",
p, mu_t
);
characters = vec![get_bob()];
enemies = (0..2).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"Bob won {:.2}% of battles against 2 Bandits in an average of {:.1} turns.",
p, mu_t
);
characters = vec![get_bob(), get_george()];
enemies = (0..1).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"Bob and George won {:.2}% of battles against 1 Bandit in an average of {:.1} turns.",
p, mu_t
);
characters = vec![get_bob(), get_george()];
enemies = (0..2).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"Bob and George won {:.2}% of battles against 2 Bandits in an average of {:.1} turns.",
p, mu_t
);
characters = vec![get_bob(), get_george()];
enemies = (0..3).map(|_| get_bandit()).collect::<Vec<_>>();
let (p, mu_t) = battle_stats(characters, enemies);
println!(
"Bob and George won {:.2}% of battles against 3 Bandits in an average of {:.1} turns.",
p, mu_t
)
}