I initially wrote this for 10 elements in the octopi flashing grid
puzzle, which is why I had a 10 in there, even though I did have the
const N already. Here I rewrote it slightly, because with `try_into`
already doing a length check, mine was redundant anyway.