...in Python.
You must have Python installed, obviously.
Clone this repository:
git clone https://github.com/prodhe/sokoban.git
Or download it as a zip file:
https://github.com/prodhe/sokoban/archive/master.zip
Run
$ cd sokoban
$ python rungui.py
UP (k)
DOWN (j)
LEFT (h)
RIGHT (l)
(U)ndo movement
(R)edo movement
(Esc)ape to quit
@ + Worker
o * Crate
. Storage
# Wall
Move your worker and push the crates, until they are all in storage.
Create your own levels in a text editor or pick some from the "levels" subfolder!
#####
# #
#o #
### o##
# o o #
### # ## # ######
# # ## ##### ..#
# o o ..#
##### ### #@## ..#
# #########
#######
# import
import sokoban
# init
g = sokoban.init()
# optionally load a level
g.load("level.txt")
# or load default and also restart
g.load()
# show ascii output
g.output()
# direction (eg. (-1,0) for left)
g.move(x, y)
# movement history traversal
g.undo()
g.redo()
# when finished
game.finished() == true
by Prodhe