This commit is contained in:
2026-05-15 20:14:38 -04:00
parent fe0a7f9504
commit 87edd89c87
2 changed files with 9 additions and 2 deletions
+7 -2
View File
@@ -1,9 +1,14 @@
usage: usage:
`solve 41/63 50/60 55/55 43/64 60/66 51/55 48/59 41/63` ```
> solve 41/63 50/60 55/55 43/64 60/66 51/55 48/59 41/63
10: [Wood, Grains, String, String, Oil, Meat, Meat, Gem, Gem, Gem]
```
solves for the least number of materials needed given a priority solves for the least number of materials needed given a priority
`priority wood paper grains string oil meat` ```
> priority wood paper grains string oil meat
```
sets the material priority for solving (what to use and what to try first) sets the material priority for solving (what to use and what to try first)
+2
View File
@@ -35,6 +35,7 @@ fn main() {
"priority" => run_priority(args, &mut priority), "priority" => run_priority(args, &mut priority),
_ => { _ => {
println!("unknown command {cmd}"); println!("unknown command {cmd}");
usage();
} }
} }
print!("> "); print!("> ");
@@ -142,6 +143,7 @@ fn validate_priority(priority: &Priority) -> bool {
fn usage() { fn usage() {
println!("usage:"); println!("usage:");
println!(" > solve 41/63 50/60 55/55 43/64 60/66 51/55 48/59 41/63"); println!(" > solve 41/63 50/60 55/55 43/64 60/66 51/55 48/59 41/63");
println!(" 10: [Wood, Grains, String, String, Oil, Meat, Meat, Gem, Gem, Gem]");
println!(" solves for the least number of materials needed given a priority"); println!(" solves for the least number of materials needed given a priority");
println!(" > priority wood paper grains string oil meat"); println!(" > priority wood paper grains string oil meat");
println!(" sets the material priority for solving (what to use and what to try first)"); println!(" sets the material priority for solving (what to use and what to try first)");