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.
79 lines
2.3 KiB
Rust
79 lines
2.3 KiB
Rust
1 year ago
|
use kartsimrust::{
|
||
|
premade::{get_bob, get_george, get_horned_bear},
|
||
|
test_util::battle_stats::battle_stats,
|
||
|
};
|
||
|
|
||
|
fn main() {
|
||
|
env_logger::init();
|
||
|
|
||
|
let mut characters = vec![get_bob()];
|
||
|
let mut enemies = (0..1).map(|_| get_horned_bear()).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_horned_bear()).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_horned_bear()).collect::<Vec<_>>();
|
||
|
|
||
|
let (p, mu_t) = battle_stats(characters, enemies);
|
||
|
|
||
|
println!(
|
||
|
"Bob won {:.2}% of battles against 2 Horned Bears in an average of {:.1} turns.",
|
||
|
p, mu_t
|
||
|
);
|
||
|
|
||
|
characters = vec![get_bob(), get_george()];
|
||
|
enemies = (0..1).map(|_| get_horned_bear()).collect::<Vec<_>>();
|
||
|
|
||
|
let (p, mu_t) = battle_stats(characters, enemies);
|
||
|
|
||
|
println!(
|
||
|
"Bob and George won {:.2}% of battles against 1 Horned Bear in an average of {:.1} turns.",
|
||
|
p, mu_t
|
||
|
);
|
||
|
|
||
|
characters = vec![get_bob(), get_george(), get_bob()];
|
||
|
enemies = (0..1).map(|_| get_horned_bear()).collect::<Vec<_>>();
|
||
|
|
||
|
let (p, mu_t) = battle_stats(characters, enemies);
|
||
|
|
||
|
println!(
|
||
|
"Bob and George and Bob won {:.2}% of battles against 1 Horned Bear in an average of {:.1} turns.",
|
||
|
p, mu_t
|
||
|
);
|
||
|
|
||
|
characters = vec![get_bob(), get_george(), get_bob()];
|
||
|
enemies = (0..2).map(|_| get_horned_bear()).collect::<Vec<_>>();
|
||
|
|
||
|
let (p, mu_t) = battle_stats(characters, enemies);
|
||
|
|
||
|
println!(
|
||
|
"Bob and George won {:.2}% of battles against 2 Horned Bears in an average of {:.1} turns.",
|
||
|
p, mu_t
|
||
|
);
|
||
|
|
||
|
characters = vec![get_bob(), get_george(), get_bob()];
|
||
|
enemies = (0..3).map(|_| get_horned_bear()).collect::<Vec<_>>();
|
||
|
|
||
|
let (p, mu_t) = battle_stats(characters, enemies);
|
||
|
|
||
|
println!(
|
||
|
"Bob and George won {:.2}% of battles against 3 Horned Bears in an average of {:.1} turns.",
|
||
|
p, mu_t
|
||
|
)
|
||
|
}
|