Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. // textbasedgame.cpp : Defines the entry point for the console application.
  2. //12/15/17 - Created file, following tutorial on https://levelskip.com/classic/Make-a-Text-Based-Game
  3.  
  4.  
  5. #include "stdafx.h"
  6. #include <iostream>
  7. #include <conio.h>
  8. #include <stdlib.h>
  9. using namespace std;
  10.  
  11.  
  12. int main()
  13. {
  14. //creates variable name with 50 length for array
  15. char name[50];
  16. char race[50];
  17. char spec[50];
  18. char sex[50];
  19.  
  20. //Asks for name input
  21. cout << "What is your name, traveler?\n";
  22. cin.getline(name, 50);
  23.  
  24. //Asks for sex
  25. cout << "\n Are you man, woman, or something in between?\n";
  26. cin.getline(sex, 50);
  27.  
  28. //Asks for race
  29. cout << "What "
  30.  
  31. //Completed character build - Text to begin next stage
  32. cout << "You better move fast, " << name << ". The kobolds are attacking our town!\n";
  33. cout << "---------------Press any key to continue-------------------";
  34. _getch();
  35.  
  36.  
  37.  
  38. //Terminates program
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement