aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlee <Alee14498@gmail.com>2019-01-28 17:18:21 -0500
committerAlee <Alee14498@gmail.com>2019-01-28 17:18:21 -0500
commitda7e45bdfdf5d09c6e9ca12049a2af15dfe9877e (patch)
treee52cc2c1c2fbb1a6b44d777c8001e88a6b0ee879
parent62663f00aebe7a8fd85f3f7f8e412555a52f2876 (diff)
downloadProject-Xeon-da7e45bdfdf5d09c6e9ca12049a2af15dfe9877e.tar.gz
Project-Xeon-da7e45bdfdf5d09c6e9ca12049a2af15dfe9877e.tar.bz2
Project-Xeon-da7e45bdfdf5d09c6e9ca12049a2af15dfe9877e.zip
Added a "save" file and added new things
-rw-r--r--.gitignore2
-rw-r--r--main.cpp18
2 files changed, 18 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 470195d..1fcb152 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-out/game.exe
+out
diff --git a/main.cpp b/main.cpp
index ea77ed1..f895c13 100644
--- a/main.cpp
+++ b/main.cpp
@@ -7,19 +7,35 @@
int main()
{
int age;
- int year = 2019;
+ int year;
std::string guy;
int mainChoice;
+ std::ofstream db;
+ db.open("database.txt");
+
+ std::string warningText = "Please note that this will be not permanent, we are planning to add a encrypted save file.\n";
+
+ db << warningText;
std::cout << "Welcome to Project Xeon! A text-based game made in C++!" << std::endl;
std::cout << "Please enter your name..." << std::endl;
std::getline(std::cin, guy);
std::cout << "Hello "<< guy << "!" << std::endl;
+ db << guy;
+ std::cout << "Press anything to continue!" << std::endl;
+ system("pause>nul");
+ system("cls");
+ std::cout << "Select a year that you will be born in..." << std::endl;
+ std::cin >> year;
+ db << year;
+ std::cout << "The year is now " << year << "!" << std::endl;
+ system("pause>nul");
age = 0;
age = age+1;
year = year+1;
+ db.close();
std::cout << "You are now " << age << " and it's " << year << std::endl;
system("pause");
return 0;