Write a program that lets the user play an adventure game, Programming Languages

Let the player (denoted U in the diagram below) navigate around the board until she wins the game by finding the exit or is killed by a monster. A player begins the game with a sling. Whenever the player moves into a new space, you should give her any new information (what if anything is in the room and whether there are walls to the north, south, east, and west). If there is a monster in the room, the player automatically must fight it. Inform the player that there is a monster in the room (and what type of monster it is) and tell her the outcome of the battle. A player with a sling defeats kobolds (denoted K in the diagram below) 75% of the time and ogres (denoted O in the diagram below) 20% of the time. A player with a sword will defeat ogres 96% of the time and kobolds 99% of the time. No player will ever defeat a dragon (denoted D in the diagram below) no matter what weapon they have and a player stepping into the space with a dragon is simply eaten. Game over. If the player loses the battle, the game is over. Otherwise, let her choose one of the valid actions associated with the space:

  • Pick up any object in the room (there is never more than one object in a room and a room may contain nothing, an object, or a monster, but never more than one thing so never two monsters, never a monster and an object, never two objects).
  • Move to another space (north, south, west, or east) that is not blocked by a wall.
  • Die if she moved into a space with a pit (denoted Pit in the diagram below)

2. Whenever the player moves into a new space, you should redraw the game board showing only what the player has been thus far. Essentially, you are keeping a map for the player. Whenever you redraw the map, first clear the screen by printing new lines until the old map scrolls off the screen. 

3. The board will look like this, although you do not know how big it is, you know it won't be any bigger than 20*20 squares.


If the player has only been in the white spaces shown below from the board above.

Then show should see a map that looks like this:


You should use functions, arrays, loops, file I/O, etc where appropriate, comment your code, and design your program before you start coding.

  • The only items in the game are gold and a sword. Keep track of how much gold (denoted G in the diagram) a player has and output that if they escape the maze.
  • The only monsters are the dragon (D), kobolds (K), and ogres (O).


Posted Date: 3/15/2013 2:42:10 AM | Location : United States

Related Discussions:- Write a program that lets the user play an adventure game, Assignment Help, Ask Question on Write a program that lets the user play an adventure game, Get Answer, Expert's Help, Write a program that lets the user play an adventure game Discussions

Write discussion on Write a program that lets the user play an adventure game
Your posts are moderated
Related Questions
Real Distinct Eigenvalues Under this case we'll have the real, distinct eigenvalues l 1 ≠l 2 ≠l 3 a and their related eigenvectors, ?h 1 , ?h 2 and  ?h 3   are guarantee

I need help with some simple matlab statements

Really urgent help needed with Javascript. I have this website: I">https://www.theppcpresents.com/globe13/#/home I need to remove the video on the slider so that it only sho

Determine the moment of force about the point where a bracket is attached to a wall. the bracket is shown in figure attached. it extends 10 inched out from the wall and 5 inched up

Villa La Fourche Ltd is a small family business situated in the East Coast of Mauritius, more precisely Trou d'eau Douce.   The compound comprises of 6 independent villas, each of

Although the Document object's write()and writeln() methods are part of the DOM, they cannot be used to change content after a Web page has been rendered. You can write code that e

Question: (i) Prepare brief notes on the Logical Storage Manager. (ii) Show benefits that can be achieve by using the LSM Manager. (iii) LSM organizes and optimizes disk

1 Problem Description The task of the assignment is to build a book recommendation system for Auer Libraries. The system is to be implemented in Prolog and as the owners of t

how to concatinate two strings in assembly

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string: Found cookies expiring bef