Klotski

From Freehackers

Jump to: navigation, search

A brick game

by Bluebird

Contents

[edit] Introduction

Klotski is small brick game which has its root in a wooden game named (in french) Ane rouge. The goal is to bring the red piece to its destination by moving other pieces. It sounds simple but it is a real brainteaser.

There was a klotski game on Windows 3.1, and this is were all levels are from. There is also a basic gnome version of klotski here. I had a look at it before starting Klotski, so some design ideas have probably slipped from there :-)

[edit] Screenshot

klotski-screenshot.png

[edit] Requirements

On Linux, you need Python, Qt and PyQt. On Windows, everything works by itself :-).

[edit] History

Klotski is written in Python and uses the PyQt binding developped by Phil Thompson, to take advantage of the QCanvas from Qt.

This is my first program using python and PyQt. I must say I have enjoyed it a lot: Python and Qt are both excellent, easy to use and well documented. I have never been able to implement my ideas so quickly. The usual cycle think, organise into organigram, code, compile, correct compiling errors, run, correct bugs, run, it work was reduced to think, code, run, it works. Because of the simplicity and the power the python language, my ideas could be expressed very clearly and I could concentrate on what I wanted to do instead of how I needed to code it. The result is a simple and clean program, that was coded in half the time (and probably less) it would have taken to do it in C++.


[edit] Download

[edit] version 1.2 : 01 june 2006

[edit] version 1.1: 17 november 2004

[edit] version 1.0 : 23 january 2001


[edit] Feedback

I'm always interested in feedback, either good or bad. What would really interest me are contributions of new boards. Don't hesitate to contact me.

You can also contribute to klotski. Look at the file boards.kts, it contains the description of the board in a simple format. Adding a new board is quite easy.

[edit] Solution

Due to many requests, I have put-up a solution of the most difficult puzzle, the dreaded Ane Rouge: the solution.

Look at it only when you start to get desperate (this is, after at least one month of effort). It took me something like one month to find it. The real tricky part is the end: you have to make the red square change side else it won't go out.

[edit] Related links

  • Bricks Games, a very good sliding tile game with many levels and special pieces, web ranking, puzzles everymonth and very good things.
  • Glotski , a Gnome equivalent
  • Gnotski, another unmaintained Gnome klotski.


[edit] Other Projects of Bluebird

  • VimWrapper: a library to integrate Vim into other software
  • Vy: a generic vi engine written in Python
  • LuaUnit: a unittest framework for the Lua language
  • Klotski: a mind-breaking game
  • Yzis: a generic vi engine written in C++
  • Indent Finder: set your editor to the correct indentation automatically
  • Pretty Make: beautify your make output
  • Keep Cool: keep your CPU at low temperature while compiling.
  • KMerge: text document merging tool developed for KDE 1.

Personal tools