diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-01-12 09:45:53 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-01-12 09:45:53 +0900 |
| commit | 73520dcfd4839170c69644f031573608af340911 (patch) | |
| tree | 734a212d260f16f06be5b8ed1ab61dd97896a2bf /src | |
| parent | 700dc21f3f19064eca0cd33e21ad71c6c5b6406a (diff) | |
| download | turbofish-aquarium-73520dcfd4839170c69644f031573608af340911.tar.gz turbofish-aquarium-73520dcfd4839170c69644f031573608af340911.tar.zst turbofish-aquarium-73520dcfd4839170c69644f031573608af340911.zip | |
blink fish
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 606326e..8606420 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ struct Turbofish { x: i16, y: u16, speed: i16, - bold: bool, + blink: bool, } impl Turbofish { @@ -34,7 +34,7 @@ impl Turbofish { fn tick(&mut self) { self.x += self.speed; - self.bold = !self.bold; + self.blink = !self.blink; } } @@ -55,8 +55,8 @@ fn render(mut stdout: impl Write, school_of_fish: &Vec<Turbofish>, columns: u16) for fish in school_of_fish { let x = fish.x; let y = fish.y; - if fish.bold { - write!(stdout, "{}", termion::style::Bold).unwrap(); + if fish.blink { + write!(stdout, "{}", termion::color::Fg(termion::color::LightBlack)).unwrap(); } write!( stdout, @@ -91,7 +91,7 @@ fn main() { x, y, speed, - bold: rng.gen(), + blink: rng.gen(), }); } |
