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

+36
View File
@@ -1114,6 +1114,42 @@ not `d-46`.
# 1994
## 1994 dodsond2
### STATUS: INABIAF - please **DO NOT** fix
### Source code: [1994/dodsond2/dodsond2.c](1994/dodsond2/dodsond2.c)
### Information: [1994/dodsond2/README.md](1994/dodsond2/README.md)
When you initiate shooting via the `s` command you immediately lose an arrow
_before you choose where to shoot_.
When you shoot it will move you to that room so if you end up shooting into a
pit room you will end up dying even though you didn't explicitly move there.
### STATUS: known bug - please help us fix
A (mis)feature is that one must have had all arrows stolen in order to recover
all the arrows from the robber. This means that if you end up shooting an arrow
you can never recover all the arrows from the robber because the count of arrows
stolen can never be high enough. There are a number of ways this might be fixed,
some of which Cody notes:
- If you have zero arrows and you come across the robber you could give them all
back. This is not correct though because if you never had that many arrows you
would end up getting arrows back that you never had in the first place.
- A new variable, an `int`, could be added that keeps track of the number of
arrows you have fired and then if you come across the robber and they took the
number of arrows with the difference of the number fired then you would give
back how many (the difference) the robber stole rather than all the arrows. This
would be the right approach but there are certainly other ways to go about it.
A tip is that the number of arrows stolen is `l` and the number of arrows you
have is `i`. For the alt version that Cody added the starting number of arrows
is in the constant `W`, defaulting to 3.
You are welcome to try and fix this (mis)feature.
## 1994 ldb
### STATUS: INABIAF - please **DO NOT** fix