In this homework assignment, you will be implementing two games in C Programming Language. You are provided with stub code and some utility services (you are free to use or not use the provided utility services) in the homework bundle. The stub code contains some parts that are already implemented for you, and some functions that you should implement yourselves (marked with the comment TODO in the code). The Linux executables (64 bit) of my sample implementations for both games are also provided in the homework bundle; you can run them to try various inputs and see how your implementation should respond (try to match the output syntax exactly).
Part One – Tic-Tac-Toe
Your implementation will let two human players play the classical game of Tic-Tac-Toe by taking turns. You should check all user input, and if necessary, ask the users again for input until correct input is provided by the users.
Part Two – Dungeons and Dragons with Wumpus
The text based classic game of Dungeons and Dragons now receives a special appearance by the famous Wumpus of the Hunt the Wumpus game. The game will first be configured by the user (the single player of the game), and then the player will move from room to room in search for the gold. The unlucky adventurer will face cold death if she enters a room with a Wumpus in it. The lucky adventurer will be able to grab the gold and exit the dungeon without running into any evil Wumpuses lurking in the dungeon.
Part Three – Analysis
Write a report to answer the following questions:
- In the c file, why does the randomIntegerMaxUnBiased function generate more fair random numbers than the randomIntegerMaxNaive function? Make sure you have a sound and rigorous proof (don’t just mumble about your guesses and undeveloped ideas).
- In the game of Dungeons and Dragons with Wumpus, scientifically analyze the probabilities of the adventurer to:
- Get eaten by a Wumpus
- Exit the dungeon without the gold
- Exit the dungeon with the gold
Page 1 of 2