15_puzzle_v4

Project Description

This version handles the initiation of the 15 puzzle through cloning and applying the right - premade - costume to each clone.

The positions of all slides are collected into a list called RowList - containing id, row, column, xpos, ypos.

The gap is item 16.

At clicking the neighbours are checked through a double keep items (see nextToGap). If the gap is neighbouring, the swap between the clicked slide and the gap is done. The positions in Rowlist are updated.

TODO: the scrambling works, now I need to check the solvability. Check nr of inversions of scambled puzzle and determine if this number os odd or even. Then heck the manhattan distance of the gap to its origin. If this is too od or even - same as the inversion number, the puzzle is solvable

Created August 31, 2025

Last updated August 31, 2025

Published August 31, 2025