I am trying to create a card game in Small Basic. I create an array of cards with images and then try to move the cards by looping through 1 to 52. However, index counters 1 and 2 don't do anything, and then index 3 moves array item 1. This keeps happening until index 52 moves card 50 and leaves the last two cards unmoved. I've checked the underlying array data and the data is correct. Here's the loop:
for i=1 to 52
imgID=cards[i]["imgID"]
Shapes.ShowShape(imgID)
Shapes.Move(imgID,300,300)
EndFor
I tried this as well:
for i=1 to 2
imgID=cards[i]["imgID"]
Shapes.ShowShape(imgID)
Shapes.Move(imgID,300,300)
EndFor
for i=1 to 52
imgID=cards[i]["imgID"]
Shapes.ShowShape(imgID)
Shapes.Move(imgID,300,300)
EndFor
The first loop does nothing, but it does cause the second loop to properly start at the first card. However, in the second loop when i gets to 3 the loop does nothing for indexes of 3 and 4 and then starts up again at 5 showing card 3. I'm really at a loss to understand what is going on.