RosettaCodeData/Task/Sokoban/00-TASK.txt
2023-07-01 13:44:08 -04:00

26 lines
962 B
Text

Demonstrate how to find a solution to a given [[wp:Sokoban|Sokoban]] level. For the purpose of this task (formally, a PSPACE-complete problem) any method may be used. However a move-optimal or push-optimal (or any other -optimal) solutions is preferred.
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
<syntaxhighlight lang="text">#######
# #
# #
#. # #
#. $$ #
#.$$ #
#.# @#
#######</syntaxhighlight>
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.
For more information, see [http://www.sokobano.de/wiki/index.php?title=Main_Page the Sokoban wiki].