summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 20b9c9c..51a6ed9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,7 +40,6 @@ fn main() {
canvas.present();
let (x, y) = find_origin();
- let delay = 50;
let mut lines = Vec::new();
for i in (0..(height as i16 + 1)).step_by(50) {
lines.push(Line {
@@ -72,8 +71,8 @@ fn main() {
let mut rng = rand::thread_rng();
lines.shuffle(&mut rng);
- let a = rng.gen_range(-10.0, 10.0);
- let b = rng.gen_range(-10.0, 10.0);
+ let a = rng.gen_range(-5.0, 5.0);
+ let b = rng.gen_range(-5.0, 5.0);
let mut pixels = Vec::new();
for i in (1000..200000).step_by(10) {
@@ -106,17 +105,16 @@ fn main() {
Color::RGB(255, 255, 255),
)
.unwrap();
- canvas.present();
- thread::sleep(Duration::from_millis(delay));
}
if i < pixels.len() {
let pixel = &pixels[i];
canvas
.pixel(pixel.x, pixel.y, Color::RGB(255, 255, 255))
.unwrap();
- canvas.present();
}
+ canvas.present();
+ thread::sleep(Duration::from_millis(10));
i += 1;
}
}