This is an implementation of Gregory Yob’s Hunt the Wumpus text based 1972 game. I made this to learn some Haskell.
- clone the repo
- install stack
- cd into the directory of the repository and
stack run
The game has 20 rooms which form a dodecahedron. Rooms are numbered from 1 to 20 and each room is connected to 3 other rooms.
The game has 3 types hazards which are assigned to random, yet non-overlapping room numbers:
- These are static hazards that do not move.
- The player falls to their death when entered.
- In the original game the Wumpus can go in these rooms because it has “suckers” on its feet. However, I the way I implemented it has the Wumpus avoiding going into rooms with Bottomless pits.
- These are static hazards that do not move.
- They snatch the player to another random room when entered.
- keeps snatching the player until snatched to a non-bat room.
- The Wumpus can go into this room, but won’t be picked up because “it’s too heavy!”
- The Wumups is the monster you have to slay to win the game.
- The Wumpus is immobile when the game starts since it is asleep.
- Shooting an arrow on the map or entering the room of the wumpus will wake up the wumpus.
- When awake it has a 75% chance of moving per turn.
- The wumpus also has a 75% chance of moving out of the room when you “bump it” or first enter its room when it is asleep. Think of this as a fight or flight response. If the Wumpus stays to fight, then you lose.
You as the player:
- navigate the map in a sort of fog of war. You can only see the 3 adjacent rooms that you can move to, but you cannot see what they contain
- gain information about the map’s layout via clues from adjacent rooms. These clues come in the form of warnings. When a hazard is adjacent to your room it will print its warning.
- have a bow with 5 magical crooked arrows that can navigate the crooked halls of the cave.
- If you run out of arrows, then game over.
I have enabled a cheat mode that displays where everything on the map is and
where the Wumpus moves everything it moves. Just pass the argument “cheat” to
the game (e.g. stack exec hwump-exe -- cheat
).