aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-01-12 09:45:53 +0900
committernsfisis <nsfisis@gmail.com>2025-01-12 09:45:53 +0900
commit73520dcfd4839170c69644f031573608af340911 (patch)
tree734a212d260f16f06be5b8ed1ab61dd97896a2bf /src
parent700dc21f3f19064eca0cd33e21ad71c6c5b6406a (diff)
downloadturbofish-aquarium-73520dcfd4839170c69644f031573608af340911.tar.gz
turbofish-aquarium-73520dcfd4839170c69644f031573608af340911.tar.zst
turbofish-aquarium-73520dcfd4839170c69644f031573608af340911.zip
blink fish
Diffstat (limited to 'src')
-rw-r--r--src/main.rs10
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(),
});
}