Here is my ongoing Sokoban/map compression project.
B is a levelset, stored as a list. SOKOBAN is the game. Run it like "∟LEVEL:prgmSOKOBAN", where LEVEL is the name of the levelset. The keys are the directional keys and clear.
The levels were made by David W. Skinner: http://users.bentonrea.com/~sasquatch/sokoban/
The first 20 are the first 20 from Microban, and the 21st level is Sasquatch III #41.
SOKLEVMA is the level compressor. To use it, you put the level in matrix form, in matrix A.
0 is an empty space
1 is a wall
2 is a box
3 is a goal
5 is the protagonist
-1 is a box already on a goal
Then, just run SOKLEVMA, and it puts the single level in L1. In order to play it, you need to put it in a levelset. A levelset is just a bunch of levels augmented together, with Pi-1 as the first element.
Right now everything is a 3x3 tile, so it looks hella confusing. The goal squares are the squares with dots at the corners; the boxes are just boxes, and boxes on goal squares are boxes without dots at the corners.
Heh, the programming is pretty crappy as well, utilizing several Gotos and Lbls. But the compression is pretty cool; it fits 21 levels in 885 bytes, by encoding the map in binary format with a variable-length code.
I'm planning on adding the ability to play the game with 5x5 or 7x7 sprites. For smaller levels, it'll use the 7x7, and for really big levels (for example, level 21 of the default levelset), it'll stick with the 3x3 sprites.
Check it out. Any ideas, suggestions, optimizations?