C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 14th, 2016, 09:59 AM
chew42 chew42 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2016
Posts: 1 chew42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 26 sec
Reputation Power: 0
General - My first Adventure Text story.

I know it might not be perfect as this is my first week learning how to program using c++. If there is any tips you can give me or point out any mistakes I would really appreciate it.

Code:
#include <iostream>
#include <string>
using namespace std;

int main()

{
	cout << "#############################" << endl;
	cout << "\n_-=Story of the pale woman=-_\n" << endl;
	cout << "#############################" << endl;
	cout << " \n\n ------------------------------------" << endl;
	cout << "| Please enter your character's name: ";
	string name; 
	cin >> name; 
	cout << " ------------------------------------" << endl;


	cout << "| Now please enter your character's age: ";
	string age;
	cin >> age;
	cout << " ------------------------------------" << endl;

	cout << "| Is your character male or female: ";
	string MaleOrFemale;
	cin >> MaleOrFemale;
	cout << " ------------------------------------\n\n" << endl;

	cout << "Your character's name is " << name;

	cout << " and ";

	if (MaleOrFemale == "male")
	{
		cout << "he is ";
	}

	else if (MaleOrFemale == "female")
	{
		cout << "she is ";
	}
	cout << "" << age << " years old.\n\n" << endl;

	cout << "Select your character's home" << endl;
	cout << "[1]Apartment" << endl;
	cout << "[2]House" << endl;
	cout << "[3]I'm homeless" << endl;
	string home;
	cin >> home;

	if (home == "1") {
		cout << "\n\nYou are sitting in your dark apartment as your electricity" << endl;
		cout << "went out. You are sitting on your bed surrounded by" << endl;
		cout << "smere light that is emitted from your laptop's screen." << endl;
		cout << "Suddenly you hear a knock on your door. You look at your" << endl;
		cout << "clock and see that it is 2am. You start wondering who can" << endl;
		cout << "it be at this time.\n\n=What do you do?=\n" << endl;
	}

	else if (home == "2") {
		cout << "\n\nYou are sitting in your dark house as your electricity" << endl;
		cout << "went out. You are sitting on your bed surrounded by" << endl;
		cout << "smere light that is emitted from your laptop's screen." << endl;
		cout << "Suddenly you hear a knock on your door. You look at your" << endl;
		cout << "clock and see that it is 2am. You start wondering who can" << endl;
		cout << "it be at this time.\n\n=What do you do?=\n" << endl;
	}

	else if (home == "3") {
		cout << "\nWell...that's unfortunate. I'm afraid you cannot continue" << endl;
		cout << "but don't worry, good things will start to happen.\n" << endl;
		cout << "THE END\n" << endl;

		return 0;
	}

	{
		cout << "You can either:" << endl;
		cout << "[1] Ignore it" << endl;
		cout << "[2] Open it" << endl;
		cout << "[3] Look through the window" << endl;

	}
	string option1;
	cin >> option1;
	if (option1 == "1") {
		cout << "\n\nYou chose to ignore it.\n" << endl;
		cout << "5 minutes have passed and it seems like the knocking has stopped." << endl;
		cout << "After 10 more minutes the knocking comes back but this time..." << endl;
		cout << "The knocking becomes even more louder and even more aggressive." << endl;
		cout << "\n=What do you do?=\n" << endl;
		cout << "You can either:" << endl;
		cout << "[1] Ignore it" << endl;
		cout << "[2] Go investigate it" << endl;
	}


	else if (option1 == "2") {
		cout << "\n\nYou choose to open it.\n" << endl;
		cout << "You make your way to the front door." << endl;
		cout << "You slowly reach for the door handle" << endl;
		cout << "and you pull it down, opening the door" << endl;
		cout << "but you look around and see no one at the door" << endl;
		cout << "Damn kids, alway pranking...\n" << endl;
		cout << "THE END\n" << endl;

		return 0;
	}

	else if (option1 == "3") {
		cout << "\n\nYou choose to look through the window.\n" << endl;
		cout << "There is nobody there...strange." << endl;
		cout << "You go back to your room to try to sleep" << endl;
		cout << "However the knocking continues...but this time" << endl;
		cout << "It is even louder.. " << endl;
		cout << "You ignore it and try to fall asleep in hope that the" << endl;
		cout << "knocking will stop. It does after a couple of minutes." << endl;
		cout << "You manage to fall asleep" << endl;
		cout << "However...you are woken up to the opening sound of" << endl;
		cout << "your bedroom door..." << endl;
		cout << "\nTHE END\n" << endl;

		return 0;

		;
	}



	string opt1dec1;
	cin >> opt1dec1;

	if (opt1dec1 == "1") {
		cout << "\n\nYou ignore it again and you go to sleep.\n" << endl;
		cout << "The next morning you wake up and look out the window." << endl;
		cout << "The colour of your face turns pale and terror runs down" << endl;
		cout << "your body as you realise..." << endl;
		cout << "The knocking was on the window when you see the massive handprint on it" << endl;
		cout << "\nTHE END\n" << endl;

		return 0;
	}

	else if (opt1dec1 == "2")
	cout << "\n\nYou stand up and grab your phone as a source for light." << endl;
	cout << "You start making your way to the front door" << endl;
	cout << "A source of light is being emitted from the hallway" << endl;
	cout << "You continue moving forward to find out what is happening." << endl;
	cout << "You finally make your way to the door and you freeze in place..." << endl;
	cout << "You see yourself...unconscious laying on the floor while" << endl;
	cout << "the fire is spreading around you." << endl;
	cout << "The knocking is the firemen trying to break down the front door" << endl;
	cout << "\nTHE END\n" << endl;



	;
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - My first Adventure Text story.


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap