Re: [gDesklets] 15 pieces puzzle: finding solvable puzzles



Hi there,

I have just put a testing version of the 15 pieces desklet to the
desklets-basic branch on launchpad.

Please feel free to play around a bit and see if the parity of the sum
of "the number of inversions" and "the row of the empty tile" can be
used to determine if a puzzle can actually be solved (even) or not
(odd). So far it looks pretty promissing (IMHO).

There are still a lot of print outs to the log for further investigation
 that have been commented out but this should make it easier for anybody
to take a closer look at the things going on ;).
And I wouldn't include the status label on top of the puzzle (showing
even/odd etc.) in the released desklet either.

Anyway, the code needs to be cleaned etc. , too.

Furthermore there needs to be a way to deal with unsolvable puzzles ;).

I am thinking of letting the user have a chance to decide on his/her own:
- either re-shuffle (randomize) until we have an "even" puzzle
- change one (or the first) inversion (this should work if the tiles are
next to each other).

Any ideas, comments etc. ?

Greetings, Bjoern



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]