Skip to content

Commit

Permalink
Tweak characters
Browse files Browse the repository at this point in the history
  • Loading branch information
maneatingape committed Sep 5, 2023
1 parent da1302f commit 7e295bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/year2019/day13.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,23 @@ fn _draw(tiles: &[i64], score: i64, blocks: i64) {
}

let mut s = String::new();
s.push_str(&format!("{HOME}{CLEAR}{WHITE}{BOLD}Blocks: {blocks}\tScore: {score} {RESET}\n"));
s.push_str(&format!("{WHITE}{BOLD}Blocks: {blocks}\tScore: {score} {RESET}\n"));

for y in 0..20 {
for x in 0..44 {
match tiles[44 * y + x] {
0 => s.push(' '),
1 => s.push_str(&format!("{GREEN}#{RESET}")),
2 => s.push_str(&format!("{BLUE}o{RESET}")),
1 if y == 0 => s.push_str(&format!("{GREEN}_{RESET}")),
1 => s.push_str(&format!("{GREEN}|{RESET}")),
2 => s.push_str(&format!("{BLUE}#{RESET}")),
3 => s.push_str(&format!("{WHITE}{BOLD}={RESET}")),
4 => s.push_str(&format!("{YELLOW}{BOLD}.{RESET}")),
4 => s.push_str(&format!("{YELLOW}{BOLD}o{RESET}")),
_ => unreachable!(),
}
}
s.push('\n');
}

println!("{s}");
println!("{HOME}{CLEAR}{s}");
sleep(Duration::from_millis(20));
}

0 comments on commit 7e295bb

Please sign in to comment.