We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72c7003 commit 3e15dddCopy full SHA for 3e15ddd
day10b/src/main.rs
@@ -2,8 +2,8 @@ use std::io::Read;
2
3
fn do_cycle(cycle: i16, x: i16) {
4
let pos = cycle % 40;
5
- print!("{}", if pos >= x && pos <= x + 2 { '█' } else { ' ' });
6
- if cycle % 40 == 0 {
+ print!("{}", if pos >= x - 1 && pos <= x + 1 { '█' } else { ' ' });
+ if pos == 39 {
7
println!();
8
}
9
@@ -12,7 +12,7 @@ fn main() {
12
let mut input = String::new();
13
std::io::stdin().read_to_string(&mut input).unwrap();
14
15
- let mut cycle = 1;
+ let mut cycle = 0;
16
let mut x = 1;
17
for line in input.lines() {
18
let prev_cycle = cycle;
0 commit comments