Skip to main content
added 138 characters in body
Source Link
user16402
user16402
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exitThe wumpus ate you&&exit C h p&&$j F&&exitYou fell in the pit&&exit C u w&&$j WYou smell the wumpus C u h&&$j PYou feel a breeze from a pit read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$jYou A;w=$killed the wumpus&&exit;$j You missed;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
  19. Style fix for q().
  20. re-added proper output
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
  19. Style fix for q().
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j The wumpus ate you&&exit C h p&&$j You fell in the pit&&exit C u w&&$j You smell the wumpus C u h&&$j You feel a breeze from a pit read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j You killed the wumpus&&exit;$j You missed;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
  19. Style fix for q().
  20. re-added proper output
Swapped a NL for a space in the q() definition to keep style with the next 2 lines.
Source Link
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){   $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
  19. Style fix for q().
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){  $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 
  1. Initial release, 698 chars
  2. Fixed bug where "You feel a breeze" and "You smell the wumpus" can't display at the same time; saved 39 chars by making the random number generation a function.
  3. Remembered that the wumpus moves if you shoot and miss. 726 chars.
  4. Made grep -oE a variable. Saved 5 chars.
  5. Made [a-z]{3} a variable. Saved 3 chars.
  6. Made echo a variable. Saved 5 chars.
  7. Acted on most of @Dennis 's suggestions. Saved 72 chars.
  8. Added all remaining suggestions. Saved 68 chars.
  9. Saved 2 chars from @DigitalTrauma 's suggestion.
  10. Fixed a major bug where you can only shoot the wumpus if it is on the right. Same character count.
  11. Used parameter expansion to shave off 2 chars using $m.
  12. Shaved off a lot of chars by ditching grep and being slightly more sensible.
  13. Defined C as a regexp search function to use in if statements, and E as a function printing "You killed the wumpus" and exiting.
  14. Saved 1 char by "if statement" rearrangement.
  15. Saved a lot of chars by getting rid of d, and removed unnecessary brackets.
  16. Fixed bugs. Added lots of chars :(
  17. MOARR SAVINGS (http://xkcd.com/1296/)
  18. Another of @Dennis 's ideas (saving a few chars), and my crafty (ab)use of indirection (saving 1 char).
  19. Style fix for q().
deleted 21 characters in body
Source Link
user16402
user16402

Bash, 368365 (first working version 726!)

CATCHING UP WITH GOLFSCRIPT! 29 CHARS TO GO!!!?

p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&{ p=$y;r=$b;}||F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 

Bash, 368 (first working version 726!)

CATCHING UP WITH GOLFSCRIPT! 29 CHARS TO GO!!!

p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&{ p=$y;r=$b;}||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 

Bash, 365 (first working version 726!)

CATCHING UP WITH GOLFSCRIPT?

p=t r=r j=echo Z=npoemfsgnohtksblbtpckdpljqnriogelfhkbqrcaiadjhagimsmjtqecrdf q(){ $j ${Z:RANDOM%19*3:1};} C(){ [[ ${!1} =~ ${!2} ]];} d(){ s=${Z:30#$1*3-30:3};} w=`q` h=`q` for((;;));{ b=$p d $p u=u${s#*$r}$s C w p&&$j D&&exit C h p&&$j F&&exit C u w&&$j W C u h&&$j P read i F=5 y=${u:i/10:1};C i F&&p=$y&&r=$b||{ d $w;C y w&&$j I&&exit;$j A;w=${s:RANDOM%3:1};};} 
added 10 characters in body
Source Link
user16402
user16402
Loading
added 112 characters in body
Source Link
user16402
user16402
Loading
deleted 150 characters in body
Source Link
user16402
user16402
Loading
added 58 characters in body
Source Link
user16402
user16402
Loading
added 178 characters in body
Source Link
user16402
user16402
Loading
added 178 characters in body
Source Link
user16402
user16402
Loading
deleted 255 characters in body
Source Link
user16402
user16402
Loading
added 65 characters in body
Source Link
user16402
user16402
Loading
added 104 characters in body
Source Link
user16402
user16402
Loading
added 55 characters in body
Source Link
user16402
user16402
Loading
deleted 109 characters in body
Source Link
user16402
user16402
Loading
added 170 characters in body
Source Link
user16402
user16402
Loading
deleted 79 characters in body; added 20 characters in body
Source Link
user16402
user16402
Loading
added sample run
Source Link
user16402
user16402
Loading
added 47 characters in body
Source Link
user16402
user16402
Loading
saved 3
Source Link
user16402
user16402
Loading
added 136 characters in body
Source Link
user16402
user16402
Loading
added 283 characters in body; deleted 73 characters in body
Source Link
user16402
user16402
Loading
added 283 characters in body
Source Link
user16402
user16402
Loading
added 799 characters in body
Source Link
user16402
user16402
Loading
Source Link
user16402
user16402
Loading