diff --git a/src/bin/chars/main.rs b/src/bin/chars/main.rs index 6d5e6be..fbe5a07 100644 --- a/src/bin/chars/main.rs +++ b/src/bin/chars/main.rs @@ -70,24 +70,24 @@ fn main() -> std::io::Result<()> { .collect::>(); for x in 0..(x_size / 8) { for y in 0..(y_size / 8) { - let fg = colors[rng.gen_range(0, colors.len())] + let fg = colors[rng.gen_range(0..colors.len())] .interpolate(Color::black(), 0.8 * rng.gen::()); - let bg = colors[rng.gen_range(0, colors.len())] + let bg = colors[rng.gen_range(0..colors.len())] .interpolate(Color::black(), 0.8 * rng.gen::()); - let start_index = rng.gen_range(0, buffer.len() / 8) * 8; + let start_index = rng.gen_range(0..buffer.len() / 8) * 8; let bitmap = &buffer[start_index..(start_index + 8)]; paint_char(&mut frame, x, y, bitmap, fg, bg); } } loop { if rng.gen::() < 0.02 { - let x = rng.gen_range(0, x_size / 8); - let y = rng.gen_range(0, y_size / 8); - let fg = colors[rng.gen_range(0, colors.len())] + let x = rng.gen_range(0..x_size / 8); + let y = rng.gen_range(0..y_size / 8); + let fg = colors[rng.gen_range(0..colors.len())] .interpolate(Color::black(), 0.8 * rng.gen::()); - let bg = colors[rng.gen_range(0, colors.len())] + let bg = colors[rng.gen_range(0..colors.len())] .interpolate(Color::black(), 0.8 * rng.gen::()); - let start_index = rng.gen_range(0, buffer.len() / 8) * 8; + let start_index = rng.gen_range(0..buffer.len() / 8) * 8; let bitmap = &buffer[start_index..(start_index + 8)]; paint_char(&mut frame, x, y, bitmap, fg, bg); }