Skip to content

Commit

Permalink
more struggles with 17
Browse files Browse the repository at this point in the history
  • Loading branch information
rtsuk committed Dec 22, 2022
1 parent 564e001 commit bc71651
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/bin/day17.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ struct Opt {
/// Run step by step
#[structopt(short, long)]
interactive: bool,

/// Limit
#[structopt(short, long, default_value = "2022")]
limit: usize,
}

#[derive(Debug, Clone, Copy)]
Expand Down
10 changes: 4 additions & 6 deletions src/bin/day19.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ fn main() -> Result<(), Error> {

let blueprints = parse(if opt.puzzle_input { DATA } else { SAMPLE });


let bp = &blueprints[0];

let mut robots = Robots {
Expand All @@ -199,15 +198,14 @@ fn main() -> Result<(), Error> {
let mut resources = Resources::default();

for time in 1..=24 {
println!("#### time {time}: robots = {robots:#?} ");
println!("#### time {time}: robots = {robots:#?} ");
resources += resources_made(&robots);
println!("resources = {resources:#?} ");
println!("resources = {resources:#?} ");
let (new_robots, remainder) = legal_order(resources, &bp);
println!("new_robots = {new_robots:#?}");
println!("remainder = {remainder:#?}");
println!("new_robots = {new_robots:#?}");
println!("remainder = {remainder:#?}");
robots += new_robots;
resources = remainder;

}

Ok(())
Expand Down

0 comments on commit bc71651

Please sign in to comment.