From dc920fb56406647147a52dee6ad09e02fb16b638 Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Thu, 25 Jul 2019 22:06:12 -0700 Subject: [PATCH] Initial commit for Hunt the Wumpus - Adding some text strings from the original. --- examples/wump/LICENSE | 1 + examples/wump/Makefile | 17 ++++++++++++++ examples/wump/wump.info | 41 +++++++++++++++++++++++++++++++++ examples/wump/wump_strings.pvvs | 34 +++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 examples/wump/LICENSE create mode 100644 examples/wump/Makefile create mode 100644 examples/wump/wump.info create mode 100644 examples/wump/wump_strings.pvvs diff --git a/examples/wump/LICENSE b/examples/wump/LICENSE new file mode 100644 index 0000000..5de269e --- /dev/null +++ b/examples/wump/LICENSE @@ -0,0 +1 @@ +TODO: Import the correct license for `wump.info` and for text strings from `wump.c`. diff --git a/examples/wump/Makefile b/examples/wump/Makefile new file mode 100644 index 0000000..079f0a3 --- /dev/null +++ b/examples/wump/Makefile @@ -0,0 +1,17 @@ +# (c) 2019 Aaron Taylor +# All rights reserved. + +include ../config.mk + +all: wump + +wump: + $(CPP) $(CPP_FLAGS) -o temp.pvvs wump_strings.pvvs + $(VVS_COMPILER) -i temp.pvvs -o wump.vvs + @rm -f temp.pvvs + +run: wump + $(VVS_INTERPRETER) -i wump.vvs + +clean: + @rm -f wump.vvs temp.pvvs diff --git a/examples/wump/wump.info b/examples/wump/wump.info new file mode 100644 index 0000000..329e821 --- /dev/null +++ b/examples/wump/wump.info @@ -0,0 +1,41 @@ +Welcome to the game of Hunt the Wumpus. + +The Wumpus typically lives in a cave of twenty rooms, with each room having +three tunnels connecting it to other rooms in the cavern. Caves may vary, +however, depending on options specified when starting the game. + +The game has the following hazards for intrepid adventurers to wind their +way through: + + Pits -- If you fall into one of the bottomless pits, you find yourself + slung back out on the far side of the Earth and in very poor + shape to continue your quest since you're dead. + + Bats -- As with any other cave, the Wumpus cave has bats in residence. + These are a bit more potent, however, and if you stumble into + one of their rooms they will rush up and carry you elsewhere in + the cave. + + Wumpus -- If you happen to walk into the room the Wumpus is in you'll find + that he has quite an appetite for young adventurous humans! Not + recommended. + +The Wumpus, by the way, is not bothered by the hazards since he has sucker +feet and is too big for a bat to lift. If you try to shoot him and miss, +there's also a chance that he'll up and move himself into another cave, +though by nature the Wumpus is a sedentary creature. + +Each turn you may either move or shoot a crooked arrow. Moving is done +simply by specifying "m" for move and the number of the room that you'd +like to move down a tunnel towards. Shooting is done similarly; indicate +that you'd like to shoot one of your magic arrows with an "s" for shoot, +then list a set of connected room numbers through which the deadly shaft +should fly! + +If your path for the arrow is incorrect, however, it will flail about in +the room it can't understand and randomly pick a tunnel to continue +through. You might just end up shooting yourself in the foot if you're +not careful! On the other hand, if you shoot the Wumpus you've WON! + +Good luck. + diff --git a/examples/wump/wump_strings.pvvs b/examples/wump/wump_strings.pvvs new file mode 100644 index 0000000..a4278db --- /dev/null +++ b/examples/wump/wump_strings.pvvs @@ -0,0 +1,34 @@ +@ Imported from: +@ $NetBSD: wump.c,v 1.17 2005/02/15 12:56:20 jsm Exp $ +@ Copyright (c) 1989, 1993 +@ The Regents of the University of California. All rights reserved. + +@ TODO: Import the license properly. + +NSSVTTTTTTTTSSSSSSSSN | Mark: 11111111 00000000 (wump_kill) +A"\n*ROAR* *chomp* *snurfle* *chomp*!\nMuch to the delight of the Wumpus, you walked right into his mouth,\nmaking you one of the easiest dinners he's ever had! For you, however,\nit's a rather unpleasant death. The only good thing is that it's been\nso long since the evil Wumpus cleaned his teeth that you immediately\npassed out from the stench!\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSSSTN | Mark: 11111111 00000001 (kill_wump) +A"\n*thwock!* *groan* *crash*\nA horrible roar fills the cave, and you realize, with a smile, that you\nhave slain the evil Wumpus and won the game! You don't want to tarry for\nlong, however, because not only is the Wumpus famous, but the stench of\ndead Wumpus is also quite well known, a stench plenty enough to slay the\nmightiest adventurer at a single whiff!!\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSSTSN | Mark: 11111111 00000010 (no_arrows) +A"\nYou turn and look at your quiver, and realize with a sinking feeling\nthat you've just shot your last arrow (figuratively, too). Sensing this\nwith its psychic powers, the evil Wumpus rampagees through the cave, finds\nyou, and with a mighty *ROAR* eats you alive!\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSSTTN | Mark: 11111111 00000011 (shoot_self) +A"\n*Thwack!* A sudden piercing feeling informs you that the ricochet\nof your wild arrow has resulted in it wedging in your side, causing\nextreme agony. The evil Wumpus, with its psychic powers, realizes this\nand immediately rushes to your side, not to help, alas, but to EAT YOU!\n(*CHOMP*)\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSTSSN | Mark: 11111111 00000100 (jump) +A"\nWith a jaunty step you enter the magic tunnel. As you do, you\nnotice that the walls are shimmering and glowing. Suddenly you feel\na very curious, warm sensation and find yourself in room %u!!\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSTSTN | Mark: 11111111 00000101 (pit_kill) +A"*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\nThe whistling sound and updraft as you walked into this room of the\ncave apparently wasn't enough to clue you in to the presence of the\nbottomless pit. You have a lot of time to reflect on this error as\nyou fall many miles to the core of the earth. Look on the bright side;\nyou can at least find out if Jules Verne was right...\n" +NTN | RTS + +NSSVTTTTTTTTSSSSSTTSN | Mark: 11111111 00000110 (pit_survive) +A"Without conscious thought you grab for the side of the cave and manage\nto grasp onto a rocky outcrop. Beneath your feet stretches the limitless\ndepths of a bottomless pit! Rock crumbles beneath your feet!\n" +NTN | RTS -- 2.20.1