A challenging logic test for all you coders out there:
I need for the next version of
KSMAS a system to be able to swap images.
For every image there is a list of other available slots either filled or not with which to swap current image (/item).
Now I need a system (probably recursive) to swap all files as the user wants and troubleshoot any weird combination (more than one pointing to a slot, etc.).
So we have an array of images:
12345
and if we want to swap item 2 with item 5, the returned swap-array would be:
15345
and that would set up the images-array as follows:
15342
got my point? Good!
It's possible that it's rather simple, but I'm stuck atm.
So, please, help me if you have any clue.
Thanks.