I'm learning Rust and I wanted to write program that would take a (randomly generated) bowling sheet and generate the score. I now know that I will have to use Rusts Vecs instead of arrays but I got stuck at accessing the value from the nested arrays so I would like to find the solution before I re-write it.
What I wanted to do is access the individual values and run some logic on them, but I got stuck at the "accessing values" part, this is what I came up with (but it doesn't work):
let sheet: [[u32; 2]; 10] = [[1, 3], [0, 6], [9, 0], [0, 5], [5, 3], [4, 2], [1, 4], [2, 3], [3, 0], [4, 4]];
for frame in 0..sheet.len() {
for score in 0..sheet[frame].len() {
println!("{}", sheet[frame[score]]);
}
}