Sokoban Level 2a

From NetHackWiki
Revision as of 10:59, 28 August 2006 by BlackShift (talk | contribs) (style)
Jump to navigation Jump to search

This version of the second level of sokoban is often considered one of the hardest. There are 16 boulders and 12 holes.

0 boulder
^ pit
@ starting position/downstairs
< upstairs
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.0-----0-.|   |.........|
|..|...|.0.|   |....<....|
|.0.0....0-|   |.........|
|.0..0..|..|   |.........|
|.----0.--.|   |.........|
|..0...0.|.--  |.........|
|.---0-...0.------------+|
|...|..0-.0.^^^^^^^^^^^^.|
|..0......----------------
-----..|..|
    -------


Strategy

The following solution solves the level without putting any blocks in an immobile position. Faster solutions which do not leave every boulder free exist.

All boulders are replaced by letters so they can be referenced to. Moving the boulders is shortened to r for right, l for left, u for up, d for down. An asterisk is used to denote the last move filled a pit (and thus removed the boulder from the game). So Prrru means move boulder P three times to the right and once up.

 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----B-.|   |.........|
|..|...|.C.|   |....<....|
|.D.E....F-|   |.........|
|.G..H..|..|   |.........|
|.----I.--.|   |.........|
|..J...K.|.--  |.........|
|.---L-...M.------------+|
|...|..N-.0.^^^^^^^^^^^^.|
|..P......----------------
-----..|..|
    -------

first make some room in the bottom

Prrru
Orr*
Ndlllll
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----B-.|   |.........|
|..|...|.C.|   |....<....|
|.D.E....F-|   |.........|
|.G..H..|..|   |.........|
|.----I.--.|   |.........|
|..J...K.|.--  |.........|
|.---L-...M.------------+|
|...|.P.-....^^^^^^^^^^^.|
|.N.......----------------
-----..|..|
    -------

make a pathway in the upper right

Bdd
Cl
Ml
Fu
Bll
Kd
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----.-.|   |.........|
|..|...|CF.|   |....<....|
|.D.E.B...-|   |.........|
|.G..H..|..|   |.........|
|.----I.--.|   |.........|
|..J.....|.--  |.........|
|.---L-K.M..------------+|
|...|.P.-....^^^^^^^^^^^.|
|.N.......----------------
-----..|..|
    -------

clear the lower half, using the 'loop' above 'M' and the 2x3 turning space in the lower right. (Notice how the end always is 'lllrrrrrrruurdrrrrrr*', with the amount of 'r' depending on the amount of filled pits.)

Mrdrrr*
Nrrrrrrruurdrrrr*
Kddlllllrrrrrrruurdrrrrr*
Lddlllrrrrrrruurdrrrrrr*
Prdlllrrrrrrruurdrrrrrrr*
Idrdddlllllrrrrrrruurdrrrrrrrr*
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----.-.|   |.........|
|..|...|CF.|   |....<....|
|.D.E.B...-|   |.........|
|.G..H..|..|   |.........|
|.----..--.|   |.........|
|..J.....|.--  |.........|
|.---.-.....------------+|
|...|...-..........^^^^^.|
|.........----------------
-----..|..|
    -------


Now it depends on whether you want to be able to have all the boulders freely moving after you finish the level. In this solution all boulders can be moved freely.

create a pathway on the right

CdFl

enter the middle room and remove boulder B

AuGrDuEr
Bddd

restore pathway in the left

DdAd
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----.-.|   |.........|
|..|...|F..|   |....<....|
|.D..E..C.-|   |.........|
|..G.H..|..|   |.........|
|.----..--.|   |.........|
|..J..B..|.--  |.........|
|.---.-.....------------+|
|...|...-..........^^^^^.|
|.........----------------
-----..|..|
    -------

using the large loop around the entire level to clean more boulders

Brdddlllllrrrrrrruurdrrrrrrrrr*
Jrrrrlllllrrrrrrruurdrrrrrrrrrr*
Erdddrdddlllllrrrrrrruurdrrrrrrrrrrr*
Hrrdddddlllllrrrrrrruurdrrrrrrrrrrrr*
Grrrrdddddlllllrrrrrrruurdrrrrrrrrrrrrr*
 ----          -----------
--.@--------   |.........|
|..........|   |.........|
|.A-----.-.|   |.........|
|..|...|F..|   |....<....|
|.D.....C.-|   |.........|
|.......|..|   |.........|
|.----..--.|   |.........|
|........|.--  |.........|
|.---.-.....------------+|
|...|...-................|
|.........----------------
-----..|..|
    -------