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

Assignment Help:

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.

1450_game.png

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:

2498_game1.png

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).

 


Related Discussions:- Write a program that lets the user play an adventure game

Program to explore page replacement algorithms, Objective: The purpose of ...

Objective: The purpose of this programming project is to explore page replacement algorithms. This can be accomplished by developing a simple simulator that implements various pag

Write a function called triple, Write a function called triple (in a file c...

Write a function called triple (in a file called 'triple.m'). That takes a single variable x and returns a single variable in which every element of x is multiplied by 3. Make sure

ActionScript, looking for help with a flash game assignment.

looking for help with a flash game assignment.

Write the html code to bind this xml data, Question: (a) (i) Describe w...

Question: (a) (i) Describe what an XML Data Island is and outline the restrictions of using a Data Island. (ii) The following XML file book.xml is used to keep track of a l

Class a abstract data type, Class a Abstract Data Type: is a template for c...

Class a Abstract Data Type: is a template for creating objects. A class describes a collection of related objects i.e. instances of the classes. Basically classes are user-defined

C programming, Write an interactive C program which prompts the user with t...

Write an interactive C program which prompts the user with the following options on the opening menu: 1) Student information 2) Theory counselling batch-scheduling

What are attributes in html langauge, What are Attributes in HTML langauge?...

What are Attributes in HTML langauge? A few tags have attributes. An attribute is a name, followed through an = sign, followed by the value. For instance, to make a centered H1

What is the switch statement, What is the switch Statement? This is a dif...

What is the switch Statement? This is a different form of the multi way decision that It is well structured, but can only be used in certain cases where: 1. Here, Only one var

Computer design project , I''m studying electrical engineering, and this se...

I''m studying electrical engineering, and this semester im taking course that called Computer Design. in this course they need me to a final project about any thing we took during

Design an application that opens and analyses word files, Design an applica...

Design an application that opens and analyses word files. Requirements: Create an application that analyses text documents. It should open a text file, read each word in

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd