remove unnecessary prints
This commit is contained in:
5 files changed
+18
-18
No files matched your search
+9
-9
@@ -187,21 +187,21 @@ pub fn part2(input: &str) -> Result<String, std::io::Error> {
|
||||
let mut machine = parse(input);
|
||||
|
||||
let swaps = vec![("z06", "ksv"), ("nbd", "kbs"), ("z20", "tqq"), ("z39", "ckb")];
|
||||
print!("before:\n{}", machine);
|
||||
// print!("before:\n{}", machine);
|
||||
for (a, b) in &swaps {
|
||||
machine.swap(a, b);
|
||||
}
|
||||
println!("after:\n{}", machine);
|
||||
|
||||
println!("x : {:048b} ({0})", machine.register('x'));
|
||||
println!("y : {:048b} ({0})", machine.register('y'));
|
||||
println!("expected : {:048b} ({0})", machine.expected_result());
|
||||
println!("actual : {:048b} ({0})", machine.actual_result());
|
||||
// println!("after:\n{}", machine);
|
||||
//
|
||||
// println!("x : {:048b} ({0})", machine.register('x'));
|
||||
// println!("y : {:048b} ({0})", machine.register('y'));
|
||||
// println!("expected : {:048b} ({0})", machine.expected_result());
|
||||
// println!("actual : {:048b} ({0})", machine.actual_result());
|
||||
|
||||
let diff = machine.actual_result() ^ machine.expected_result();
|
||||
println!("error : {diff:48b}");
|
||||
// println!("error : {diff:48b}");
|
||||
let first_error = diff.trailing_zeros();
|
||||
println!("first error at bit {first_error}");
|
||||
// println!("first error at bit {first_error}");
|
||||
|
||||
let mut file = File::create("day24.dot").unwrap();
|
||||
writeln!(file, "graph day24 {{").unwrap();
|
||||
|
||||
Reference in new issue
Block a user