Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 3.36 KB

4.TextGame.md

File metadata and controls

64 lines (50 loc) · 3.36 KB

OOP 2014

Homework 4

Due date: Sunday, June 15th, 2014, 23:59:59 (end of the semester)


Some organizational details

You'll receive 4 homework throughout the semester. We expect you to submit a .zip archive (not a .rar, not a .7zip, not a .tgz). The archive should meet the following criteria:

  1. Naming convention: hw<homework_number>.group<group_number>.<fn>.zip where:
  • <homework_number> is the number of the current homework

  • <group_number> is the number of your group ([O, rly?][1])

  • <fn> is your faculty number

    That's ok: hw3.group2.66666.zip
    That's not: hw3.g2.66666.zip, hw3.group2.fn66666.zip, hw3.group2.66666.rar

  1. Contents: you should only submit source and header files (.h, .cpp) and NOTHING else, no folders, no executables, no .dll-s, no .lib-s, no .o-s, nothing else

Failing to meet any of the above will get you 0 points. Now for the interesting stuff.


Problem 4. Designing your own system - text based game

You are to design and implement a system of your own. We won't give you any specific code. We don't expect any particular implementation. Most importantly - we won't judge too harsh on your decisions since this most likely is your first time creating a OO system of your own. We've outlined some principles below, try to stick to them. Your grade will be based on:

  • Source code readability
  • How difficult is understanding your classes and their functionality
  • How easily can your system be changed (by adding / removing classes, modifying existing code)

You are free to use any C++ feature (even stuff we haven't showed you - move semantics, smart pointers, etc.)

The game itself

You are to write a text based adventure game, played directly in the console. Here's a sample game:

Greetings, traveler. Welcome to the Fmilandia. Please tell me your name and your class. (Use 1 for algrebraist , 2 for turing machine engineer, 3 for derivative explorer)
Nikola 2
Nikola, as a turing machine engineer you are required to kill the mighty Context Free monster - a^nb^n since he has been hunting the people in the woods. Enter the woods now to look for a^nb^n? (y/n)
y
The might a^nb^n stands before you! What do you do? (1 - attack with the Pumping Lemma, 2 - call Ditchev for help, 3 - cry like a little girl)
...

And so on, you get the idea. Note - that was just an example, you don't have to adhere to it - your game might tell the story of Pokemon or 'The Bold and the Beautiful'. The only real requirement is to have something kinda-playable with at least a few different options at a time

Some principles to guide you

  • Create a new class for each different type of entity in the game (i.e. a Human, a Dragon)
  • Create a new class / struct for each different type of static object (i.e. a Chest, a Building, a Town)
  • Choose appropriate methods and fieldsa
  • Create a few managing classes for controlling the game (i.e. class Game)
  • Make your int main method as short as possible - ideally it should look like this:
int main() 
{
    Game game;
    game.Run();
    return 0;
}

You might want to check here or here for more guidelines.