In this code, you generated a random u32 and then converted it to a usize to match the sprite index type. What you wanted was an f32 between 0.1 and 0.9. You can replace this code with a version that takes advantage of range() being generic:
The highlighted sentence seem like it came from a different part of the book (as it doesn’t even match the type in preceding one). This was suppose to be an “usize between 1 and 6”