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.
3.7 KiB
To build:
make all
There is an alternate version 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
For more detailed information see 1994 dodsond2 in bugs.md.
To use:
./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:
make alt
The default number of arrows in this version is 3 but if you want to change it, say to 5, try:
make clobber CDEFINE="-DW=5" alt
Alternate use:
./dodsond2.alt
Judges' remarks:
Each year people find new ways to squeeze more and more out of the contest rules. Next year, entries that use compression utilities to get around the size limit will find themselves squeezed out of the contest!
A historical note:
The original source code was submitted as a GZIP compressed file that the file(1) command reports as:
dodsond2.gz: gzip compressed data, last modified: Mon Aug 29 21:54:39 1994, max compression, from Unix, original size modulo 2^32 2652
The dodsond2.gz file was submitted as source in an effort to get around the 1994 version of Rule 2:
2) Your entry must be <= 3217 bytes in length. The number of characters
excluding whitespace (tab, space, newline), and excluding any ; { or }
followed by either whitespace or end of file, must be <= 1536.
Indeed, when dodsond2.gz is uncompressed, it is identical to the dodsond2.c file you find today.
The IOCCC rules and guidelines were modified in an effort to address this fun "abuse of the rules" style hack.
It is worth noting that without this compression "abuse of the rules" style hack, the 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 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.
But beware that shooting an arrow and missing the Wumpus may
awaken him.
There is a robber who waits in an unknown room. If you enter that room carrying an arrow, he will steal that arrow from you and move to a new room. If he steals all the arrows in the Caverns, you may catch him and recover all of them. Doing this gives you a bonus on your score.
You can quit at any time by typing q. Typing i will tell
you how many arrows you are carrying. l prints the description
of the current room again.
Copyright and CC BY-SA 4.0 License:
This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:
Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
For more information, see: https://creativecommons.org/licenses/by-sa/4.0/