Fix bug of 1994/dodsond2 wrt arrows stolen
The problem was that one could never get their arrows back from the robber if they ended up shooting an arrow because that means the number of arrows stolen could never be the right number of arrows. Now if the number of arrows stolen (when you encounter the robber) is equal to the number of arrows you found - the number of arrows you shot you get arrows back: as long as the robber took some of course. At this point the counters are reset so that the check does not fail the next time. Previously it compared to just 3 as there are only three arrows. But in the alt version (which was helpful to test this out more) this is obviously a problem even if it wasn't in the original. It was however a problem in the original because if you shot an arrow you could not get them back even if you have zero and encounter the robber. Of course now the check has to verify first (&&...) that the number of arrows stolen > 0 as otherwise the variables could get messed up. This should actually complete 1994/dodsond2 unless of course I missed something/made a mistake here.
This commit is contained in:
1 parent
9c568df22f
commit
1181899ed9
5 files changed
+23
-39
No files matched your search
@@ -1126,29 +1126,6 @@ _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
|
||||
|
||||
@@ -1406,6 +1383,7 @@ example is in macOS).
|
||||
|
||||
If you can fix this we welcome it!
|
||||
|
||||
|
||||
## 1996 gandalf
|
||||
|
||||
### STATUS: missing or dead link - please provide them
|
||||
|
||||
Reference in new issue
Block a user