[Kde-games-devel] KSudoku new engine

Johannes Bergmeier Johannes.Bergmeier at gmx.net
Mon Nov 16 22:49:30 CET 2009


I finished the solver of my new engine and the JavaScript support for it. 
Currently I'm porting KSudoku to it in a private git repository. All changes 
go to the backend of KSudoku which is not visible to the user and have 
undergone heavy testing.

Features of the new engine:

-- It is designed in a more complex but consistent way --
Games are described by a Ruleset which consists of Items which describe for 
example cells or constraints or even both. From this Ruleset there can be 
created instances called Problems. Those problems contain Storages to store 
values for different Items in a compact way. Then there are is the Solver which 
solves problems and will later allow other operations which could be used for 
example for generating games with different difficulty or for providing 
interactive help.

-- It is easy to extend --
Ruleset, Solver and Problems are the same for any kind of game. Only the used 
Items vary. If someone wants to implement a new kind of Item (e.g. a new rule 
which requires some cells to sum up to a specific value) he only has to code 
the new Item and if required a new Storage class. While the concept of 
storages is not the easiest one there should exist enough implementations of 
them to understand how they work.

-- Scriptable games --
The new engine has a Ruleset based on QtScript. With this it should be easy to 
create custom variants of KSudoku. While they currently don't provide much 
advantages over the old format they will later make it possible to script 
interactive help or custom generators for puzzles.

If nobody has concerns I will commit this changes to trunk next time I reach a 
stable state.

Regards
Josel


More information about the kde-games-devel mailing list