# Introduction

In the game of sokoban you control a warehouse keeper (keeper for short), which has to push crates or gems (the term we will use) or whatever to designated places, called goals. It doesn't matter which gem goes on which goal, only that in the end every gem is on a goal.

The task of the keeper is complicated by a number of restrictions:

- The movement of the keeper is restricted by walls. This means, you cannot move through walls.

- The keeper cannot push gems through walls.

- The keeper can only push a gem and not pull it.

- The keeper can only push one gem at once.

Because of the aforementioned restrictions you may reach a position, in which you cannot solve the level (a so called deadlock), so you should always try to think a few steps ahead, to avoid such situations.

Lets look at a snapshot of a sokoban level shown below:

A simple sokoban level

It is the first level of David W. Skinner's Microban collection. The green man is the keeper (the look of the keeper is dependent on the theme you use; we will use the default theme throughout the documentation). The two blue spheres are the two gems. The yellow circle with the red border is a goal. Note that there are actually two goals, as you might expect as there are two gems. The second goal is obscured by a gem, which already sits on a goal. You can see this, because the red border of the goal is still visible.

EasySok show the number of moves, pushes, linear pushes and gem changes in the status bar (the latter two are normally not shown; you can change this via the configuration dialog). A move is the movement of the keeper by one field without considering, if he pushed a stone). A push is the movement of a stone by one field. Linear pushes are a variant of pushes. If you push a gem in the same direction many fields, this counts only as one linear push. Gem changes are the number of times you switched from pushing one stone to pushing another. All four measures should be kept as low as possible (you can compare your solutions by any of the four measures), but this is not always possible. Sometimes you can trade in increase in the number of pushes to a decrease in the number of moves and so on. Traditionally the number of pushes is considered 'the' criterion for the quality of a solution, but recently the number of linear pushes and gem changes has gained more acceptance.