Fixes in 1994/dodsond2 + add alt code

Fixed bug where in some cases the program would enter an infinite loop,
forcing one to kill the program.

Fixed bug where only if you had more than one arrow would shooting it
take you to the room you shoot into (it now will do it even if you're
using the last arrow). This fix is done the same way as the above fix
was made as they both have to do with shooting the final arrow.

The alt code allows one to cheat by configuring (at compile time) the
number of arrows to start out with. If one loses (as in stolen) all
their arrows it will be (of course) 0 but if one also gets to the robber
they'll get back the 3 + starting number of arrows (in the original this
is just 3) assuming they have had that many stolen. That is a
(mis)feature or maybe a bug that is carried over from the original entry
that might or might not want to be fixed. I described how it might be
done in the bugs.md but as I don't have time to do it now, focusing
instead on the README.md files of the remaining entries.  The alt
version might allow one to more easily test this.

Besides the above (mis)feature or bug added to the bugs.md some features
that should not be fixed were added to bugs.md. It is questionable
whether or not the above should be fixed but it seems like since there
is dead code, if one ends up shooting an arrow then they cannot get
back the arrows that were stolen even they have have lost all that they
did not shoot, that it should be fixed. But it might be argued that
you're not supposed to get any back if you shoot them since in that case
these were already spent/used. At the same time one could argue that you
should at least get back the ones that were stolen.
This commit is contained in:
Cody Boone Ferguson committed 2023-11-10 08:19:09 -08:00
1 parent 934ac91291
commit eecc3146c4
8 files changed
+177 -17

No files matched your search

+52 -11
View File
@@ -5,12 +5,53 @@ make all
```
There is an [alternate version](#alternate-code) that allows you to cheat,
giving you a configurable amount of arrows at the start of the game.
### Bugs and (Mis)features:
The current status of this entry is:
```
STATUS: INABIAF - please **DO NOT** fix
STATUS: known bug - please help us fix
```
For more detailed information see [1994 dodsond2 in bugs.md](/bugs.md#1994-dodsond2).
## To use:
```sh
./dodsond2
```
## Alternate code:
This version allows you to choose how many arrows to start with, instead of the
default 0. If one tried specifying a value < 0 it will set it to 0.
### Alternate build:
```sh
make alt
```
The default number of arrows in this version is 3 but if you want to change it,
say to 5, try:
```sh
make clobber CDEFINE="-DW=5" alt
```
### Alternate use:
```sh
./dodsond2.alt
```
## Judges' remarks:
@@ -50,19 +91,19 @@ style hack, the [dodsond2.c](dodsond2.c) is further obfuscated.
## Author's remarks:
Go searching for the Wumpus in the Caverns of Doom! But be careful...
There are pits and bats waiting to seal your fate, as well as a\
stealthy robber lurking in the shadows. Move through the rooms by\
typing the number of the adjacent room you wish to visit. You can\
feel a breeze if there is a pit in an adjacent room. A rustling sound\
will tell you that bats are nearby. The scent of the evil Wumpus can\
There are pits and bats waiting to seal your fate, as well as a
stealthy robber lurking in the shadows. Move through the rooms by
typing the number of the adjacent room you wish to visit. You can
feel a breeze if there is a pit in an adjacent room. A rustling sound
will tell you that bats are nearby. The scent of the evil Wumpus can
be detected from 2 rooms away.
To win, you must find one or more arrows, determine where the Wumpus\
is, and shoot him, all without falling into a pit or becoming the\
next meal for the Wumpus. To shoot an arrow, type `s`. Then give a\
list of the rooms you want to shoot into. The rooms must be\
connected in the order you list them, or else the arrow may bounce\
back and hit you. An arrow can go through as many as four rooms.\
To win, you must find one or more arrows, determine where the Wumpus
is, and shoot him, all without falling into a pit or becoming the
next meal for the Wumpus. To shoot an arrow, type `s`. Then give a
list of the rooms you want to shoot into. The rooms must be
connected in the order you list them, or else the arrow may bounce
back and hit you. An arrow can go through as many as four rooms.
But beware that shooting an arrow and missing the Wumpus may
awaken him.