Adding new game to KPat – trying to figure out crashing bug

Karl Ove Hufthammer karl at huftis.org
Fri Oct 12 18:35:38 BST 2018


Hi, KDE game developers,

I’m trying to add a new solitaire variant to KPat, based on the old 
Windows game Midnight Sunitaire. I don’t know if it has a chance to ever 
be accepted in the *official* release (for one, it doesn’t have a 
solver), but I find it fun to play.

I have gotten it to a state where it seems to work fine, except for one, 
quite severe, bug. If I press the ‘Demo’ button, KPat tries to solve the 
game. But when it runs out of legal moves to make, KPat just crashes.

My initial guess for reason for the crash was that I hadn’t implemented 
a solver. KPat then seems to just pick random(?) valid moves. But I have 
tried *removing* the solver for other games, and KPat does *not* crash 
for these games when it runs out of valid moves; the demo just stops.

I have examined my code, but haven’t be able to figure out the reason 
for the crash. I can’t see any significant difference between the 
implementation of my new solitaire variant and the other solitaire 
variants in KPat. Are there any developers here willing to take a look? 
I can upload the source code (e.g. to Phabricator).


Regards,
Karl Ove Hufthammer



More information about the kde-games-devel mailing list