Sokoban: Difference between revisions

From Rosetta Code
Content added Content deleted
(The task is straightforward, so, besides possible wording issues, I think it's good enough to not be a draft. I'll provide at least one implementation soon (hopefully).)
 
((emphasis))
Line 12: Line 12:
* * is a box on a goal
* * is a box on a goal


Sokoban solutions are usually stored in the LURD format, where lowercase l, u, r and d represent a move in that direction and capital LURD represents a push.
Sokoban solutions are usually stored in the LURD format, where lowercase l, u, r and d represent a move in that, ('''l'''eft, '''u'''p, '''r'''ight, '''d'''own), direction and capital LURD represents a push.


Please state if you use some other format for either the input or output, and why.
Please state if you use some other format for either the input or output, and why.

Revision as of 05:34, 28 May 2011

Task
Sokoban
You are encouraged to solve this task according to the task description, using any language you may know.

Find a solution to a given Sokoban level. While move-optimal or push-optimal (or any other -optimal) solutions are better, this task only requires finding a solution.

Sokoban levels are usually stored as a character array where

  • space is an empty square
  • # is a wall
  • @ is the player
  • $ is a box
  • . is a goal
  • + is the player on a goal
  • * is a box on a goal

Sokoban solutions are usually stored in the LURD format, where lowercase l, u, r and d represent a move in that, (left, up, right, down), direction and capital LURD represents a push.

Please state if you use some other format for either the input or output, and why.

For more information, see the Sokoban wiki.