Ex Bibliotheca

The life and times of Zack Weinberg.

Tuesday, 23 July 2002

# 1:55 AM

Seth: All of the Nethack Sokoban levels are solvable without destroying boulders, as long as you're playing 3.3.1 or later. And you don't want to destroy boulders, because you get penalized to the tune of -1 luck for every boulder you smash. Having negative luck is Very Bad.

Cleverer people than me have worked out complete instructions for solving Sokoban; they're available from Kate Nepveu's spoilers page. [You can safely load that page without being spoiled about anything.]

I find it helps immensely to instruct Nethack (via ITEMS=, or boulder= in 3.4.0) to use digit zero for boulders instead of backquote. This makes it harder to get confused about which square the boulder is in when you're below it. Since zero is normally only used for iron balls, which are rare and (in color mode) drawn in a different color, there's no real risk of confusion with another object. Just make sure your font has readily-distinguishable glyphs for zero and capital O, or that boulder may turn out to be an ogre.

Another handy nethack tip, if you feel up to hacking the source, you play in color tty mode, and your tty displays bright-black as a visible color — the x86 Linux console does; to check, execute this shell script with any modern Bourne shell:

for a in '' '1;'
do   for x in 0 1 2 3 4 5 6 7 8
     do   printf '\033[%s3%sm%s' $a $x $x
     done
     echo
done
printf '\033[0m'

... is to cause Nethack to stop confusing black and blue objects. You can do this by applying this patch to win/tty/termcap.c:

Black objects will then appear as dark gray, not dark blue, which makes it (e.g.) possible to tell the difference between a pit and a rust trap, or a black dragon and a blue dragon. Note that this patch only works for systems that define both UNIX and TERMINFO; other systems do color with different code, elsewhere in that file, that I'm not about to try to hack up.

A minor complaint: LiveJournal URLs tend to look like this:

http://www.livejournal.com/talkread.bml?journal=myth&itemid=314952

Note the ampersand. The W3C HTML validator (correctly) objects to this, but if you substitute & then some browsers mangle the URL, and if you substitute %26 then the LJ CGI scripts don't understand the URL. The latter, at least, damn well ought to work.