Slow down chars mode.

This commit is contained in:
Juergen Stuber 2018-12-31 20:34:58 +01:00
parent 360bc5f392
commit 75ca3a28e5
1 changed files with 16 additions and 14 deletions

View File

@ -62,20 +62,22 @@ fn main() -> std::io::Result<()> {
.take(y_size) .take(y_size)
.collect::<Vec<_>>(); .collect::<Vec<_>>();
loop { loop {
let x = rng.gen_range(0, x_size / 8); if rng.gen::<f64>() < 0.01 {
let y = rng.gen_range(0, y_size / 8); let x = rng.gen_range(0, x_size / 8);
let color = pick_color(c0, c1, &mut rng); let y = rng.gen_range(0, y_size / 8);
let start_index = rng.gen_range(0, buffer.len() / 8) * 8; let color = pick_color(c0, c1, &mut rng);
for i in 0..8 { let start_index = rng.gen_range(0, buffer.len() / 8) * 8;
let b = buffer[start_index + i]; for i in 0..8 {
for j in 0..8 { let b = buffer[start_index + i];
frame[y * 8 + i][x * 8 + j] = { for j in 0..8 {
if b & (1 << j) != 0 { frame[y * 8 + i][x * 8 + j] = {
color if b & (1 << j) != 0 {
} else { color
Color::black() } else {
} Color::black()
}; }
};
}
} }
} }