Build a Text Adventure Challenge Project (C++)

Couldn’t figure out a scenario where I use the For loop in this instance. Had fun doing this and surprisingly it worked!

I have used C/C++ before and wanted to make a project.

It was fun, although I had to remember how the syntax, C++ libraries, and type errors work again.

[GitHub - CornSnek/build-a-text-adventure]

path to wild wisdom GitHub - Mairoslav/codecademyChallengeProjects

I need some help. For some reason when I try to run this, it skips the 2nd choice input.

It works normally until the code hits the 3rd loop and I cannot figure out how the 3rd loop breaks the 3rd loop

#include
#include
int main(){

std::string playerName;
int choice1;
bool luck = true;

std::cout << “-----------------------------------------------------------\n”;
std::cout << " WELCOME TO THE SHATTERED PLAINS\n";
std::cout << “-----------------------------------------------------------\n\n”;

std::cout << “You wake up in the Prison, a squat stone building with no windows. \nYou’re cold and sore and can barely remember your name.\n\nWhat is your name?\n”;

std::cin >> playerName;

std::cout << “\nThat’s right! Your name is " << playerName <<”.\n\n";

std::cout << “Suddenly you are dragged to Trial\n\n” << “Judge: " << playerName << " You are accused of kidnapping Princess Nadia. How do you Plead?\n\n”;

// First choice for the player

for(int i = 0; choice1 != 1 && choice1 != 2 && choice1 != 3 && i < 3; i++)
{std::cout << “\nHow do you Plead? (1-3)\n\n”;
std::cout << “1) Innocent!\n”;
std::cout << “2) Guilty\n”;
std::cout << “3) Stay Silent\n\n”;
std::cin >> choice1;
std::cout << "Confirm tries: " << i;}
switch (choice1){
case 1:
std::cout << “\nJudge: I see. The Jury will decide if you are tellling the truth. Chancellor, feel free to question the defendant.\n”;

              break;
case 2:
  std::cout << "You are executed for kidnapping the Princess. People generally take that pretty seriously. Maybe don't admit to that in your next life.\n\nGame Over\n";
   return 0;

case 3:
  std::cout << "\nJudge: Keeping silent won't help you. The Jury will decide your fate Chancellor, feel free to question the defendant.";
            break;

default:
std::cout << “\n\nYou did not enter a valid response.\n\n Game Over\n”;
return 0;
}

// Second choice for the player

int choice2;

std::cout << “Chancellor: Gladly! Witnesses say that you and the Princess had an altercation at the fair.\n Who caused the altercation?\n”;

for (int i = 0; choice2 != 1 && choice2 != 2 && choice2 !=3 && i < 3; i++){
std::cout << “What do you decide to say? (1-3)\n\n”;
std::cout << “1) I did.\n”;
std::cout << “2) She did.\n”;
std::cout << “3) It was an accident!\n\n”;
std::cin >> choice2;}

switch(choice2){

  case 1:
    std::cout << "\n\nChancellor: He admits to it! Ladies and gentlemen of the jury. This man is clearly guilty!\nThe crowed boos and jeers at you.\n";
    std::cout << "Judge: ORDER! ORDER IN THE COURT!";
      break;
  
  case 2:
    std::cout << "\n\nChancellor: I see, trying to push the blame on to the innocent princess! Ladies and gentlemen of the jury. This man is clearly guilty!\nThe crowed boos and jeers at you.\n";
      break;

    case 3:
      std::cout << "\nChancellor: An accident you say? Princess-napping is no accident!\n";
        break;
    
    default:
      std::cout << "\n\nYou did not enter a valid response.\n\n Game Over\n";
        return 0;
    }

// Player choice 3
int choice3;

std::cout << “\nChancellor: It is time for the verdict! Do you have any last words?\n\n”;
std::cout << playerName << “: I’m innocent! She asked me to show her around! Ask her yourself!\n\n”;
std::cout << choice2 <<“\n\n”;

 for(int i = 0; choice3 != 1 && choice3 != 2 && choice3 != 3 && i < 3; i++){

     std::cout << "1) Screw you all for framing me!\n";
     std::cout << "2) Please Princess, help me!\n";
     std::cout << "3) I have nothing more to say.\n\n";
     std::cin >> choice3; 
  }

  switch(choice3){
      case 1:
        std::cout << "The jury did not like that! You didn't buy yourself any sympathy points with that outburst.\n\n";
          break;

      case 2:
        std::cout << "The court was in such a frenzy that they hadn't listened the princess's story.\nShe now has a chance to explain that it was all her idea to run off together.\nYou breathe a sigh of relief.\n\n";
          break;

        case 3:
          std::cout << "The jury doesn't know what to make of this silence.\n\n";
            break;

        default:
          std::cout << "\n\nYou did not enter a valid response.\n\n Game Over\n";
            return 0;        
  }
   std::cout << "Judge: Members of the Jury. You have heard the testimony of " << playerName << " in this case of kidnapping the Princess.\nWhat is your verdict?\n\n";

Here is by Spiderman game lol

#include <iostream>

int main() {
  int answer1;
  int answer2;
  int answer3;

  int progress = true;
  int retry = 1;
  
  while (retry == 1) {
      std::cout << "Welcom to the story of the Amazing Spiderman!!!\n\n";
    
      std::cout << "A radioactive spider bites Peter - Y/N\n\n";
      std::cout << "1) Yes\n";
      std::cout << "2) No\n";
      std::cin >> answer1;
    
      std::cout << "Peter becomes a hero! - Y/N\n\n";
      std::cout << "1) Yes\n";
      std::cout << "2) No\n";
      std::cin >> answer2;
    
      std::cout << "Peter goes to Brookyn Bridge - Y/N\n\n";
      std::cout << "1) Yes\n";
      std::cout << "2) No\n";
      std::cin >> answer3;
    
      int ending = 100 * answer1 + 10 * answer2 + answer3;
      
      switch(ending) {
          case 111:
          std::cout << "Green Goblin kills Gwen\n";
          std::cout << "You got ending 1 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 112:
          std::cout << "Green Goblin kills Gwen & Peter\n";
          std::cout << "You got ending 2 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 121:
          std::cout << "Green Goblin kills Gwen\n";
          std::cout << "You got ending 3 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 122:
          std::cout << "Peter Saves Gwen and Green Goblin kills Peter\n";
          std::cout << "You got ending 4 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 211:
          std::cout << "Peter robs bankk Green Goblin kills Gwen\n";
          std::cout << "You got ending 5 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 212:
          std::cout << "Green Goblin kills Gwen & Peter kills Green Goblin\n";
          std::cout << "You got ending 6 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 221:
          std::cout << "Peter Saves Aunt May and Green Goblin kills Gwen\n";
          std::cout << "You got ending 7 of 8. Want to try again?\n";
          std::cout << "1) Yes\n";
          std::cout << "2) No\n";
          std::cin >> retry;
          break;
          case 222:
          std::cout << "Peter Saves Gwen and Green Goblin goes to jail\n";
          std::cout << "Congratulations; you got the perfect ending!!!\n";
          retry = 2;
          break;
      }
  }
return 0;
}

Storyline text-adventure project:

Hello world! :raising_hand_man:, I made a project based on Hansel and Gretel story. I changed the ending of the story. :grin: :blush:

Below is a link to my Github:
cy4adil/hansel_and_gretel: A short storyline project of Hansel and Gretel in C++ (github.com)

Thanks :blush:

#include
#include

using namespace std;

void intro() {
cout << “Welcome, lowColor. You are a Red, born into the mines of Mars.” << endl;
cout << “But you dream of something greater, something that will lift you above the chains of your color.\n”;
cout << “Your journey to rise through the ranks begins now.\n”;
}

void branch1() {
cout << “\nYou have found a hidden passage in the mines that could lead to the surface.\n”;
cout << “What will you do?\n”;
cout << “1. Explore the passage.\n”;
cout << “2. Stay with your fellow miners.\n”;
}

void branch2() {
cout << “\nYou’ve reached the surface and see the luxurious world of the Golds. A rebel group approaches you.\n”;
cout << “What will you do?\n”;
cout << “1. Join the rebellion and fight for the freedom of the Reds.\n”;
cout << “2. Sneak into Gold society and try to rise from within.\n”;
}

void branch3() {
cout << “\nYou have joined the rebellion and infiltrated the Gold Institute. Now, you must face the final trial.\n”;
cout << “What will you do?\n”;
cout << “1. Fight the other contestants to become Primus.\n”;
cout << “2. Form alliances with the other lowColors to overthrow the Golds.\n”;
}

void ending1() {
cout << “\nYou explore the hidden passage and emerge into the harsh Martian wilderness. Without resources, you perish.\n”;
cout << “Ending: A tragic end in the wilderness.\n”;
}

void ending2() {
cout << “\nYou decide to stay with your fellow miners, but your chance to rise has passed. You live out your days in the mines.\n”;
cout << “Ending: A life of quiet resignation.\n”;
}

void ending3() {
cout << “\nYou join the rebellion, but the Golds catch wind of your plans. You are executed for treason.\n”;
cout << “Ending: The rebellion falls, and so do you.\n”;
}

void ending4() {
cout << “\nYou infiltrate the Gold society, cunningly rising through the ranks. You become a powerful figure, hiding your true origins.\n”;
cout << “Ending: You rise, but at the cost of your identity.\n”;
}

void ending5() {
cout << “\nYou fight your way to become Primus, earning respect through sheer strength. But the Golds still rule, and you must now serve them.\n”;
cout << “Ending: Victory at a cost. You survive, but the Golds still hold power over you.\n”;
}

void ending6() {
cout << “\nYou form alliances with others, overthrowing the oppressive Golds. Together, you forge a new future for all Colors.\n”;
cout << “Ending: Victory for the people. You have changed the world.\n”;
}

int main() {
int choice;
int tries = 3;

intro();

// First branch
do {
    branch1();
    cin >> choice;
    
    if (choice == 1) {
        cout << "You chose to explore the passage...\n";
        break;
    } else if (choice == 2) {
        cout << "You chose to stay with your fellow miners...\n";
        ending2();
        return 0; // End game
    } else {
        cout << "Invalid choice. Try again.\n";
        tries--;
    }
} while (tries > 0);

if (tries == 0) {
    cout << "You hesitated too long and missed your chance.\n";
    return 0;
}

// Second branch
tries = 3;
do {
    branch2();
    cin >> choice;

    if (choice == 1) {
        cout << "You chose to join the rebellion...\n";
        break;
    } else if (choice == 2) {
        cout << "You chose to sneak into Gold society...\n";
        ending4();
        return 0; // End game
    } else {
        cout << "Invalid choice. Try again.\n";
        tries--;
    }
} while (tries > 0);

if (tries == 0) {
    cout << "You hesitated too long and were caught.\n";
    return 0;
}

// Final branch
tries = 3;
do {
    branch3();
    cin >> choice;

    if (choice == 1) {
        cout << "You chose to fight for Primus...\n";
        ending5();
        return 0; // End game
    } else if (choice == 2) {
        cout << "You chose to form alliances...\n";
        ending6();
        return 0; // End game
    } else {
        cout << "Invalid choice. Try again.\n";
        tries--;
    }
} while (tries > 0);

if (tries == 0) {
    cout << "You hesitated too long and lost the opportunity.\n";
    return 0;
}

return 0;

}

#include
using namespace std;
int main(){

int answer1, answer2, answer3, answer4;
cout <<“Welcome to the Text Adventure Game!”<<endl;
cout <<“You find yourself in a dark forest with two paths ahead.”<<endl;
cout <<“Do you:”<<endl;
cout <<“1) Take the left path”<<endl;
cout <<“2) Take the right path”<<endl;
cout <<"Enter your choice: ";
cin >> answer1;
if (answer1==1){
cout <<“You walk down the left path and encounter a friendly elf.”<<endl;
cout <<“The elf offers you a magical potion.”<<endl;
cout <<"Do you: "<<endl;
cout <<“1) Accept the potion” <<endl;
cout <<“2) Politely decline” <<endl;
cout <<"Enter your choice: ";
cin >>answer2;
if (answer2==1){
cout <<“You drink the potion and feel a surge of energy. You continue your journey with renewed vigor.”<<endl;
}

else if(answer2==2){
  cout <<"The elf nods and disappears into the forest. You continue your journey alone"<<endl;
}

}

else if (answer1==2){
cout <<“You walk down the right path and find a treasure chest.”<<endl;
cout <<“The chest is locked with a riddle.”<<endl;
cout <<"Do you: "<<endl;
cout <<“1) Try to solve the riddle” <<endl;
cout <<"2) Ignore the chest and keep walking " <<endl;
cout <<"Enter your choice: ";
cin >>answer3;
if (answer3==1){
cout<<“The riddle asks: What has keys but can’t open locks?”<<endl;
cout <<"Do you: "<<endl;
cout <<“1) Answer A piano” <<endl;
cout <<“2) Answer A map” <<endl;
cout <<"Enter your choice: ";
cin >>answer4;

if (answer4==1){
  cout<<"The chest opens, revealing a pile of gold coins. You have found the treasure!"<<endl;
  cout <<"You spend the rest of your days in the peaceful garden, living happily ever after."<<endl;
}

else if (answer4==2){
  cout<<"The chest remains locked, and you decide to move on. You never find out what was inside"<<endl;
}
}
else if (answer3==2){
  cout <<"You walk past the chest and find a hidden path leading to a beautiful garden."<<endl;
}

}
}

Nothing special but figured i could do this short and sweet

#include <iostream>

int main() {

//title for the game
  std::cout << "=====================================\n";
  std::cout << "Welcome to the game of life's choices\n";
  std::cout << "=====================================\n\n";

// player information 
  std::string player_name;

  std::cout << "First, I need to know with whom I'm talking to...\n";
  std::cout << "What is your name?\n\n";
  std::cin >> player_name;

  std::cout << "ahhhh, yes, of course. Welcome " << player_name << " it's a pleasure to have you\n\n";

// Variables
   int answer1 = 0;
   int answer_counter = 0;
   bool success = false;
   int answer_counter2 = 0;
   int answer2 = 0;
   bool success2 = false;
   int answer3 = 0;
   int answer_counter3 = 0;

//start of game sequence
  std::cout << "tell me " << player_name << " are you a fan of games of chance?\n";
  std::cout << " 1) Yes, of course\n";
  std::cout << " 2) No, not really\n\n";
  std::cin >> answer1;
//first series of if statements with nested while loops 
  if (answer1 == 1) {
    std::cout << "Perfect answer " << player_name << " just what I was hoping for.\n";
  }
  else if (answer1 == 2) {
    while (answer_counter < 3 ) {
      std::cout << "Whatt??? why not... are you sure? Try again.\n";
      std::cout << "Do you like games of chance " << player_name << " ?\n";
      std::cout << " 1) Yes, of course\n";
      std::cout << " 2) No, not really\n\n";
      std::cin >> answer1;
       if (answer1 == 1) {
         std::cout << "Great answer " << player_name << " glad you changed your mind\n";
          success = true;
          break;
        } 
     answer_counter++;
    }
  }
// second nested while loop to allow another chance for an incorrect input. 
  else {
    std::cout << "That wasnt one of the choices " << player_name << " try again!\n";
      while (answer_counter2 < 3) {
      std::cout << "Do you like games of chance " << player_name << "?\n";
      std::cout << " 1) Yes, of course\n";
      std::cout << " 2) No, not really\n\n";
      std::cin >> answer1;
        if (answer1 == 1) {
        std::cout << "Great " << player_name << " glad you changed your mind\n";
        success = true;
        break;
        }
        else {
          std::cout << "You REALLY need to select 1 or 2 ONLY " << player_name << "!\n";
        } 
     answer_counter2++;
      }
    if (!success) {
    std::cout << "Guess you dont want to play the game.... Good bye " << player_name << ".\n";
    }

  }
//are we ready to start?!
  std::cout << "Now the fun begins........ are you ready to start??\n";
  std::cout << " 1) Yes! lets do this!!!!\n";
  std::cout << " 2) No, I dont think im ready yet.\n";
  std::cin >> answer2;

    if (answer2 == 1) {
      std::cout << "exactly what i was hoping for " << player_name << " too bad your eagerness made you rush in before fully understanding what you were getting into\n";
      std::cout << "MWHAHAHAHAHAHA....... good byeeeeeeeeeeeeeee\n";
      std::cout << "MUNCH!\n";
      std::cout << "(GAME OVER... your over eagerness walked you right into a monsters trap)\n";
  } 
    else if (answer2 == 2) {
      while (answer_counter3 < 3 ) {
      std::cout << "Come on...... dont be a chicken!!!!\n";
      std::cout << "Are you ready to start now " << player_name << "?????\n";
      std::cout << " 1) I guess soooo\n";
      std::cout << " 2) Calling me a chicken changes nothing... im still not ready.\n\n";
      std::cin >> answer3;
       if (answer3 == 1) {
        std::cout << "MWAHAHAHAHA " << player_name << " glad you changed your mind\n";
        std::cout << "MUNCH!\n";
        std::cout << "(GAME OVER... your over eagerness walked you right into a monsters trap)\n";
          success2 = true;
          break;
        } 
     answer_counter3++;
  }
  if (!success2) {
    std::cout << "Guess you dont want to play the game then.... Good bye " << player_name << ".\n";
    }
  }
}

am i doing this right? ahaha

Its called “Snow Man”
Link to my solution :Cpp_codecadey_projects/5-Loops Challenge Project/text_adventure.cpp at main · righCirith/Cpp_codecadey_projects · GitHub.
Code:
#include

int main() {
// Title
std::cout << “=======================\n”;
std::cout << " Snow Man \n";
std::cout << “========================\n”;

std::cout << "Diary:\n" << "Expedition 2024, Location: Antartica.\n" << "Day 24\n";
std::cout << "At 24,000 feet, visibility is only 3 meters. Noises at night are louder; I feel like I'm not alone. I found strange tracks in the snow that don't belong to any known animal.\n";
std::cout << "*************************************\n";
std::cout << "       / \\          /\\           /\\  \n";
std::cout << "  /\\  /   \\/ \\  /\\ /  \\   /\\ /\\ /  \\ \n";
std::cout << " /  \\/     \\  \\/  \\    \\/  \\  \\    \n";
std::cout << "*************************************\n";

// Decision Point 1
int decision1;

std::cout << "As Jack sets up camp for the night, he can't shake the feeling of being watched. The howling winds seem to carry whispers, and shadows flicker at the edge of his vision. He dismisses it as paranoia after all, the isolation is playing tricks on him.\n" << "--Jack can either--\n";
std::cout << "1) Investigate the noise\n";
std::cout << "2) Stay in the tent and ignore it\n";
std::cout << "Choice: ";

// capture user choice
std::cin >> decision1;

std::cout << "  .     .    .     .       \n"
             "     .      .     .     .     .\n"
             "               .     .     .     .\n"
             "          .            .   .    .    .\n"
             "                .      .         .     .\n"
             "    .  .          .   .     .        .\n"
             "               _/\\\\_   _/\\\\_   _/\\\\_\n"
             "              /      \\\\ /      \\\\ /    \\\n"
             "     .       /   _    \\\\     _  /      |\n"
             "             /   / \\\\    \\\\   / \\\\      |\n"
             "            /___/___\\\\____\\\\_/___\\\\______|\n";


// input validation
while (decision1 < 1 || decision1 > 2) {
    std::cout << "Invalid input. Please choose 1 or 2: ";
    std::cin >> decision1;
}


if (decision1 == 1) {     // 1) Investigate the noise
    std::cout << "He steps outside, the cold biting at his skin. In the moonlight, he sees footprints leading away from his camp large, unusual footprints. Suddenly, he spots a hulking figure in the distance: the Snowman, a legendary creature said to roam these mountains.\n";

    int decision1_5;
    // Desicion point 2
    std::cout << "--Jack Either--\n";
    std::cout << "1) Follow the footprints to learn more.\n";
    std::cout << "2) Return to his tent and barricade himself\n";
    std::cout << "Choice: ";

    // capture user choice
    std::cin >> decision1_5;

    // Input validation
    while (decision1_5 < 1 || decision1_5 > 2) {
    std::cout << "Invalid input. Please choose 1 or 2: ";
    std::cin >> decision1_5;
}       
    

    if (decision1_5 == 1) { // 1) Follow the footprints to learn more
        std::cout << "The tracks lead him to a hidden cave. Inside, he discovers ancient carvings and relics but also realizes he's not alone the Snowman emerges from the shadows.\n";
        // ending 1: Jack escapes
        std::cout << "Thinking quickly, Jack distracts the creature with a flare from his pack. He escapes back to his camp, heart racing, and makes it back to civilization, sharing the legend of the Snowman and his harrowing tale.\n";
        std::cout << "You escaped; now you are telling everyone about what you just saw.";
        std::cout << "         ~         ~~          __\n"
             "           _T      .,,.    ~--~ ^^ \n"
             "     ^^   // \\                    ~\n"
             "          ][O]    ^^      ,-~ ~\n"
             "       /''-I_I         _II____\n"
             "    __/_  /   \\ ______/ ''   /'\\_,__\n"
             "    | II--'''' \\,--:--..,_/,.-{ },\n"
             "    ; '/__\\,.--';|   |[] .-.| O{ _ }\n"
             "    :' |  | []  -|   ''--:.;[,.'\\,/ \n"
             "    '  |[]|,.--'' '',   ''-,.    |\n";


    } else { // 2) Return to his tent and barricade himself
        std::cout << "He barricades himself, trying to stay calm. The noises grow louder, and soon the Snowman is clawing at his tent, trying to get in.\n";
        //ending 2 Jack is killed
        std::cout << "The creature breaks through, and in a panic, Jack fights back. But it's no use; the Snowman is too strong, and Jack meets a tragic end, lost to the frozen wilderness.\n";
        std::cout << "YOU DIED\n";

        std::cout << "          ,-=-.       ______    \n"
          << "         /  +  \\     />----->  \n"
          << "         | ~~~ |    // -/- /    \n"
          << "         |R.I.P|   //  /  /     \n"
          << "    \\vV,,|_____|V,//_____/VvV,v,\n";
    }




} else { // 2) Stay in the tent and ignore it
    std::cout << "The noises eventually fade, and he falls asleep. In the morning, he finds the Snowman sitting quietly outside his tent, seemingly uninterested in harm.\n";
    // ending 3 Jack confronts the creature
    std::cout << "Summoning his courage, Jack confronts the creature with a makeshift weapon. In a desperate struggle, he manages to outsmart the Snowman, using the environment to his advantage. He escapes, leaving the creature behind, forever haunted by his encounter.\n";
    std::cout << "You defeat the creature....? at least you just escaped!!\n";
    std::cout << "                                             ,--,  ,.-.\n"
          << "               ,                   \\       '-,-`,'-.' | ._\n"
          << "              /|           \\    ,   |\\         }  )/  / `-,',\n"
          << "              [ ,          |\\  /|   | |        /  \\|  |/`  ,`\n"
          << "              | |       ,.`  `,` `, | |  _,...(   (      .',\n"
          << "              \\  \\  __ ,-` `  ,  , `/ |,'      Y     (   /_L\\\n"
          << "               \\  \\_\\`,   ` , ,  /  |         )         _,/\n"
          << "                \\  '  `  ,_ _`_,-,<._.<        /         /\n"
          << "                 ', `>.,`  `  `   ,., |_      |         /\n"
          << "                   \\/`  `,   `   ,`  | /__,.-`    _,   `\\\n"
          << "               -,-..\\  _  \\  `  /  ,  / `._) _,-\\`       \\\n"
          << "                \\_,,.) /\\    ` /  / ) (-,, ``    ,        |\n"
          << "               ,` )  | \\_\\       '-`  |  `(               \\\n"
          << "              /  /```(   , --, ,' \\   |`<`    ,            |\n"
          << "             /  /_,--`\\   <\\  V /> ,` )<_/)  | \\      _____)\n"
          << "       ,-, ,`   `   (_ ,\\ \\    |   /) / __/  /   `----`\n"
          << "      (-, \\           ) \\ ('_.-._)/ /,`    /\n"
          << "      | /  `          `/ \\\\ V   V, /`     /\n"
          << "   ,--\\(        ,     <_/`\\\\     ||      /\n"
          << "  (   ,``-     \\/|         \\-A.A-`|     /\n"
          << " ,>,_ )_,..(    )\\          -,,_-`  _--`\n"
          << "(_ \\|`   _,/_  /  \\_            ,--`\n";
    
}

return 0;

}

Could someone help me on making the Hello World thing and make the text I want in the middle with a color such as green please

I might have been a bit ambitious, but proud of this. I made a mystery where you’re a detective and you have to solve a case! I feel like the code is a mess, but I’ll get better with time!

edit: found a problem with one of the choices where it would break if choosing a number higher than 4, fixed it! This should be the last of it! I spent a while on this, but it was a lot of fun and I learned a lot!