improved output of day 5

This commit is contained in:
timeshifter
2026-06-27 17:59:40 +02:00
parent 0046ede219
commit cfded41d1f
+2 -3
View File
@@ -9,8 +9,6 @@ const INPUT: &str = "cxdnnyjw";
fn main() { fn main() {
part1(); part1();
println!();
part2(); part2();
} }
@@ -32,7 +30,8 @@ fn part2() {
let position = the_position.to_string().parse::<usize>().unwrap(); let position = the_position.to_string().parse::<usize>().unwrap();
if result[position] == ' ' { if result[position] == ' ' {
result[position] = the_char; result[position] = the_char;
println!("{}", result.iter().collect::<String>()); print!("\r{}", result.iter().collect::<String>());
std::io::stdout().flush().unwrap();
} }
} }
if !result.contains(&' ') { if !result.contains(&' ') {