working version

remove const

no need for RwLock as we don't use mut in thread \o/
This commit is contained in:
2022-05-05 15:20:54 +02:00
parent 66bded5763
commit 113e91dcc8
4 changed files with 297 additions and 69 deletions
+11 -1
View File
@@ -12,8 +12,18 @@ mod prelude {
}
use prelude::*;
use clap::Parser;
#[derive(Parser, Debug)]
struct Args {
/// Number of threads
#[clap(short, long, default_value_t = 1)]
threads: usize,
}
fn main() {
let args = Args::parse();
let term = Term::stdout();
term.write_line("********** Rusty Propagation (Console) 2022 **********")
.expect("Oops Looks like we have a problem here...");
@@ -29,7 +39,7 @@ fn main() {
let mut counter: u32 = 0;
loop {
counter += 1;
stats = population.propagate_new();
stats = population.propagate_new(Some(args.threads));
//population.display();
println!(
"Normal: {} Infecteds: {} Immunes: {} Deads: {}",