Monday, March 9, 2009

New power for KSudoku

Francesco did a great work when he designed KSudoku. It won the second place in a contest of Linux Format and had support for different variants of sudoku-like games from the beginning on. Even 3D puzzles are possible. It was the generic graph coloring solver which made this success possible.

Unfortunately this solver is limited to graph coloring and not very easy to maintain. This is the reason why I'm writing a new generic engine for logic problems codenamed Logine. In theory it is able to solve any logical problem that results in one (or more) static solution(s). This flexibility is reached by an extensible high performance C++ core and QtScript-based descriptions of the rules.

/* Small script demonstrating how to setup rules */

// Create a board
var board = new logine.Board(9, 9);
ruleset.addItem(board);

// Make this board accessible for the application.
ruleset.content.board = board;

// Add cells to board
for(var x = 0; x < 9; ++x) {
 for(var y = 0; y < 6; ++y) {
  var item = new logine.Choice(item, 9);
  board.setItem(item, x, y);
 }
}

// Add containers for rows, columns and blocks
ruleset.content.rows = new Array();
ruleset.content.columns = new Array();
ruleset.content.blocks = new Array();

// Add all rows and columns
for(var i = 0; i < 9; ++i) {
 var row = new logine.Sudoku(board.itemsAt(-1, i));
 ruleset.content.rows.push(row);
 ruleset.addItem(row);

 var column = logine.Sudoku(board.itemsAt(i, -1)
 ruleset.content.columns.push(column);
 ruleset.addItem(column);
}

// Add all blocks
var blocks = board.split(3, 3);
for(var i = 0; i < blocks.size(); ++i) {
 var block = new logine.Sudoku(blocks[i]);
 ruleset.content.blocks.push(block);
 ruleset.addItem(block);
}

This script will setup the rules for a standard 9x9 sudoku. This is enough for playing and solving it. Further code is required for generating games and for interactive help. Yes you read right! Interactive help! The new core is able to provide interactive help for all games generated by the computer or even entered by the user.

Not everything is completely done but I'm alomst there. So you can look forward to a great KSudoku in 4.3.

cout << "Hello Planet!" << endl;

Let me introduce myself. I'm the current maintainer of KSudoku. While I was not very active in KDE for almost a year there are great times approaching. So I want to share this with you.

What is this blog about?
  • KSudoku: This is where I'm spending most of my time now. I'm doing a complete rewrite of its core with many new features.
  • Other parts of KDE if I find the time.
  • Orchid: Currently paused Orchid is my effort to revolutionize the web. It is very modular and may be even of benefit for projects that have nothing to do with the web.
  • Other small projects.
  • Art
  • And last but not least a little bit of my personal life

I hope you enjoy reading what I have to say.

Monday, June 30, 2008

Getting back to work

After some time with no motivation to be productive I got back to coding lately. First things to do are some urgent fixes for KSudoku as KDE 4.1 is nearing the release. I have waited far to long with this. So getting back to my pet-project Orchid will have to wait. But in the meantime let me introduce Orchid. I hear again and again, how complicated it is to get into web development and I share this opinion. I think the main reason is, that with most technologies someone needs to have a broad set of skills and knowledge. For example to build a simple website with descent features in PHP someone needs to know (X)HTML, PHP itself, Javascript, CSS, SQL and how configure the servers. Mistakes may make the whole system vulnerable to attacks. This is acceptable for someone who wants to get into web-design, but for a developer who just wants to create a simple website this is to way to much. Ok, there are frameworks out there which hide the implementation details for some parts but they are not for free anyway. First you need to know about them, requiring much time of research. Then even while they take work from you, they often add further complexity like an OO-layer over Javascript. After some discussion about web-design in the #kdegames-channel i decided to create a Qt-based framework in C++. I will write more about this Orchid-project in my next post.

Monday, June 23, 2008

Hello World!

Hello World!