Picture puzzle (multiple round/pic)

The code is bout a game of puzzle picture wherein there's two buttons on top, two buttons down and 4 buttons below. The you can solve the puzzle by clicking the 4 buttons below. The 1st pic is working perfectly fine but on the next code its not, the picture from the 2nd round is still being inputes on the 1st round. (One screen only for all the codes)
How do I make the 2nd set work like the 1st one?

I don't exactly what your app does but you have many of the same blocks. You shouldn't repeat yourself. Is this block not working?


What are you simulating?

  • sliding block into empty space (the 15 puzzle?)
  • swapping adjacent pictures?
  • swapping recently selected pictures?