Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unistd.h>
- bool Guest = false; //Set to true to skip loggin.
- std::string InputForText = "# ";
- std::string Username;
- std::string Password; //Ignore this
- std::string Answer;
- bool Redo() {
- return true;
- }
- void GameHub() {
- std::cout << "Pick a game:\n";
- sleep(1);
- std::cout << "1) Roberts royal\n";
- sleep(1);
- std::cout << "2) Story\n";
- sleep(1);
- do {
- std::cout << InputForText;
- std::cin >> Answer;
- if (Answer == "1") {
- std::cout << "Sorry, but this isnt built yet.\n";
- } else if (Answer == "2") {
- std::cout << "Sorry, but this isnt built yet.\n";
- }
- } while (Answer != "1" && Answer != "2");
- if (Redo() == true) {
- GameHub();
- }
- }
- int main() {
- if (Guest) {
- GameHub();
- } else {
- bool CU;
- bool CP;
- std::cout << "log_in or register\n";
- std::cout << InputForText;
- std::cin >> Answer;
- if (Answer == "register") {
- if (Username == Password) {
- std::cout << "Enter Username:\n";
- std::cout << InputForText;
- std::cin >> Username;
- do {
- std::cout << "Enter Password:\n";
- std::cout << InputForText;
- std::cin >> Password;
- } while (Password == Username);
- std::cout << "Saving...\n";
- sleep(5);
- std::cout << "Done!\n";
- main();
- } else {
- std::cout << "Already registered.\n";
- main();
- }
- } else if (Answer == "log_in") {
- if (Username == Password) {
- std::cout << "You haven't even registered in yet.\n";
- main();
- } else {
- std::cout << "Enter username: ";
- std::cin >> Answer;
- if (Answer == Username) {
- CU = true;
- } else {
- CU = false;
- }
- sleep(1);
- std::cout << "Enter Password: ";
- std::cin >> Answer;
- if (Answer == Password) {
- CP = true;
- } else {
- CP = false;
- }
- std::cout << "Checking...";
- sleep(1);
- std::cout << "\n" << "Done!";
- if (CU == CP && CP == true) {
- std::cout << "Correct log_in.\n";
- GameHub();
- } else {
- std::cout << "Incorrect log_in.\n";
- sleep(1);
- std::cout << "Try again.\n";
- main();
- }
- }
- } else {
- main();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement