[Kde-games-devel] KDiamond patch for checking board playability

Paul B happysmileman at googlemail.com
Thu May 29 02:12:03 CEST 2008


I know that there's a feature freeze so this can't really be included 
in the game, and Stefan (the maintainer I think) says he'll work on 
it when feature freeze is over, but I made it for myself and decided 
to post it here for anyone who wants to use it. Or if Stefan thinks 
it's good he can incorporate it after feature freeze

The isPlayable() function basically just goes through each diamond, 
checking if a combination can be made from it, and then returning 
true once it finds a possible combo. If no possible matches are found 
it returns false and the game ends.
It could probably be easily modified to go through the whole board, 
count how much matches in total and keep the diamonds that can be 
used in matches in a list, so that it could display how much possible 
moves there are and you could have a hint button to highlight one of 
them at random.

The patch also includes my earlier changes to allow untimed games, 
because it seemed like this function would mainly be useful for long 
games, and I didn't want to have to revert my own code back.

If anyone has any suggestions or comments feel free to tell me.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 8392 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20080529/cc8ae2a4/attachment.bin 


More information about the kde-games-devel mailing list