I trying to design an game which works somewhat like a rubix cube. In my app if the A key is pressed the squares in the top row are supposed to move from right to left. So the square in the top right corner moves from the forth position to the third place, the third position to the second and so on. This seems to work ok until the third move. where the colour disappear and then reappears in the second spot when the A key is pressed for the 4th time. Also the first square A1 never seems to be part of the sequence. The data in the array seems fine. Is this a bug in my code or a scratch bug?
Here's the code: https://scratch.mit.edu/projects/114072698/
P.s you can press the r key to reset the array.