Browse Source

Add CLI

master
Joshua-Gordon 3 years ago
parent
commit
52e885045d
  1. 14
      src/main.rs

14
src/main.rs

@ -22,8 +22,20 @@ pub mod messy_minsat;
use crate::clause_gen::*;
use crate::maxsat::*;
use std::env;
use std::process::exit;
fn main() {
let rand_clause_list = gen_clause_list(7, 4);
let args : Vec<String> = std::env::args().collect();
if args.len() != 3 {
println!("BAD!");
std::process::exit(-1);
}
let clause_count : usize = args[1].parse().unwrap();
let var_count : usize = args[2].parse().unwrap();
let rand_clause_list = gen_clause_list(clause_count, var_count);
println!("{}", rand_clause_list);
println!("MAXSAT (By BFS): {}", solve_by_bfs(&rand_clause_list));
std::process::exit(0);
}
Loading…
Cancel
Save