###GolfScript, 269 characters###
GolfScript, 269 characters
{puts}:|;20,{;9{rand}:r~}$3<(:>"B:%d`w85>2n+Fup`y/>@D-=J7ldnx/W5XsLAb8~"{32-}%"`\24"{base}/3/{[.[~@].[~@]]}%:A=3r=0=:F;~:W;:P;{>A={0=F=}?:^P&!!{"You feel a breeze"|}*^W&!!{"You smell a wumpus"|}*'"#{'9.?r';STDIN.gets()}"'++~);(3%^=\4`={W={"Your arrow hit the wumpus"|0}{"Your arrow didn't hit anything"|W A=0=3r=:W>=.!\{"The wumpus catches you"|}*}if}{>:F;:>W=.!\{"You ran into the wumpus"|}*>P=.!\{"You fell into the pit"|}*&}if}do
Note that 163 was subtracted from the character count for the hard-coded strings. If you want debug output indicating the room numbers add the following line right after the first occurence of ^
:
' YOU 'F'->'>+++puts' DIRECTIONS [BRL] '^`+puts' PIT 'P+puts' WUMPUS 'W+puts
An example session (with additional debug output):
YOU 6->11
DIRECTIONS [BRL] [6 7 16]
PIT 7
WUMPUS 5
You feel a breeze
25
YOU 11->16
DIRECTIONS [BRL] [11 17 15]
PIT 7
WUMPUS 5
35
YOU 16->11
DIRECTIONS [BRL] [16 6 7]
PIT 7
WUMPUS 5
You feel a breeze
15
YOU 11->6
DIRECTIONS [BRL] [11 10 1]
PIT 7
WUMPUS 5
15
YOU 6->10
DIRECTIONS [BRL] [6 15 5]
PIT 7
WUMPUS 5
You smell a wumpus
14
Your arrow didn't hit anything
YOU 6->10
DIRECTIONS [BRL] [6 15 5]
PIT 7
WUMPUS 0
25
YOU 10->5
DIRECTIONS [BRL] [10 14 0]
PIT 7
WUMPUS 0
You smell a wumpus
24
Your arrow hit the wumpus