Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Assignment in C: You will write a program that draws a single level for a "Rogue­like" computer game. The program will parse a line of input text from an input file (room.txt), use the parsed text to determine the shape of the room and its contents and then draw the room. The input text file will have 6 rooms and your program should draw all six of them. Your program should also allow the user to move the hero around the rooms and pick up the treasure.

Starting

? Play Rogue for a half hour so that you get the idea of what you are building. The source code is in the examples repo.

? The string tokenizer (strtok) will be extremely useful for this assignment. Google has lots of good info about how to use it.

? Set up your assignment folder (A3). Make sure you have all of the required folders (bin, src, include, assets, docs). The input file will go in the assets folder.

? Write a program to read a line from a file and parse the line into the dimensions, doors and items for a room. Musts: do all of these to get a mark greater than zero

? Your solution must take the name of an input file as a command line parameter and use that file to draw the level.

? Your solution must use the character set from Rogue 3.6.3

? Your solution must compile without errors or warnings, must run without crashing or segfaulting

? Your soution must draw at least the outline of the first room in the test file

? Have a README file and a makefile

The Basics: 80%

Expectations for your game

? Correctly draw the room and all of the contents and doors

? Allow the hero to move around the room using the w,a,s,d keys.

? Permit the hero to pick up items by walking over them. Print the list of things the hero has picked up when the program exits.

? Prevent the hero from walking through walls or over monsters. (no need to implement any sort of combat with monsters though)

? Allow the hero to walk onto doors and stairs. Doors should not be picked up and neither should stairs.

? When the hero walks onto a door, move the hero to the room closest to that door (unless you have created a hallway drawing algorithm).Expectations for your code

? Use the ncurses library

? Use structs

? Use dynamically allocated memory and pointers

? Submission folder has src/ include/ docs/ assets/ and bin/ subdirectories that are used properly

? Source code is divided properly into .c and .h files

? Each .c file has the required header (see the policies document)

? Source code is properly indented

? Comments about function input/output and purpose are in .h files

? Comments about algorithm logic are in .c files

? Variable and function names are meaningful and are in camelCase

? A plain text file called README is in the root folder. It contains information about running and using your program as well as any known limitations of the program.

? You have a makefile that will compile your code and place the executable in the bin folder.

? Your code must compile with no error or warning messages using the ­ansi and ­Wall flags in gcc

? Have separate source files for groups of tasks that repeat, such as dealing with operations for the room, parsing, drawing, and reading the file. Have a separate file for main

? your reference list and testing document are in the docs folder and contain appropriate information.

Details about Input File

? The input file will contain six rooms. You should draw the rooms 3 across and 2 down. No room will be larger than 20 rows X 25 columns.

? Each line of the file will consist of a space­delimited line of text, no longer than 150 characters.

? Lines will not have a space at the beginning but may have trailing spaces and may have more than one space between elements.

? Lines will always have a newline at the end.

? The first element of the input string will ALWAYS be the room dimensions give as RowsXColumns (i.e. 10X12)

? The other possible elements can be in any order

? Door elements will begin with a lowercase d followed by a letter representing the wall that the door is in, followed by a position measured from north or west. e.g. de3 is a door in the east wall in position three from the north edge (where the corner is position 0).

? All other elements will begin with a lowercase letter followed by coordinates. i.e. the hero is represented by h6,8 which means that the hero is at position 6, 8 where the north west corner of the room is position 0,0 (rows,columns).

? letters that can occur in room descriptions will be limited to s(stairs), g (gold),m(magic),h(hero), p(potion), w(weapon) and m(monster). The hero will always be in the first room.

? there will never be more than one door in a wall

? You need do only minimal error checking. The input file used for grading will not contain intentional errors. You should check that the items and heros dont start in the wall and that doors are actually in the wall. adjust items by the minimum number of spaces necessary if there are errors.

? The dimensions of a room include the walls. A 10X16 room has a floor area of 8X14

? 10X16 de4 dw9 ds8 g8,7 m3,4 h6,5 p2,2 is one possible example of a room description Enhancements: 20% You can doseveral enhancements partially, or you can do one or two really thoroughly and get a good mark either way.

? write an algorithm to connect rooms with hallways

? implement combat with monsters

? allow monsters to move randomly within the level

? write an algorithm to generate a new level randomly. When the hero walks over the stairs, go to your new level.

? make an inventory tracking system that can be accessed during game play

? allow the player to use the items that have been picked up

? allow the player to save progress and reload from the save point

? implement different types of monsters that behave differently from one another

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M9728078

Have any Question?


Related Questions in C/C++

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As