Explanations and details are in the sprite, but by looking at the list and variable, if you're good at coding, you'll figure out exactly what I did from that alone!
Tip: there are more uses for this than just infinite sprites. It's a 2D list in a 1D list.