First of all, thank you very much for trying to help me. I appreciated the example that you did, but unfortunately it is different than what I need or I did not understand your suggestion. Maybe it's my fault for having explained wrong (language barriers). I am attaching an example of my project. Note that the sprites are distributed across the screen, according to the already pre determined location. The player can click on two sprites to swap them. When sprites with the first four frames (0/3/1/2 - need not be in order) are in the first line, the next four frames (5/7/6/4 or another combination of this frames) are in the second line, and so on, the player wins.