Curse Breaker

There are still some flaws in my code but here is what I have so far. I am thinking I might need to nest some if functions for a few of the features I want to include.

#include

void PrintIntroduction(int Difficulty)

{

std::cout<<"\n"<< R"(

   ________________

  |.--------------.|              Welcome

  ||     ,;;;-,   ||                    To

  ||    /;/)))))  ||                     Curse 

  ||   (;/ . .((  ||                       Breaker

  ||   ):(   > )) ||                         (Sleeping Princess Edition)

  ||  (;)\  = /(  ||

  ||   )):) .'):) ||

  ||  .:(:\_(_)(  ||

  || /`::)    `\  ||

  ||/___________\_||

  '----------------'

)";

std:: cout <<"The king has demanded your help. The princess will die if you don't heal her."; 

std:: cout << "Can you help Sir Mage? \n Current corruption cleared "<<Difficulty<<"\n";

std:: cout <<"Solve the numerical riddles your magic gives you. Are you ready,.... \n";

}

bool PlayGame (int Difficulty)

{

PrintIntroduction (Difficulty);

//This is for deciding how the curse areas are decided

const int Depth = rand();

const int Strength = rand();

const int Location = rand();

const int InfoSum = Depth+Strength+Location;

const int InfoProduct = Depth*Strength*Location;

//This is where we see those varibles in action

std::cout <<"Nodding you cast your spell immediately you are able to get a hint at the location, depth, and strength of the curse. These numbers are crucial to finding and eridicating the curse core in each area. Good luck and may the gods be on your side.";

std::cout << "\n \n The numbers add up to.... " << InfoSum;

std::cout <<"\n \n The product of all the numbers is...... " << InfoProduct << "\n \n";

int GuessDepth, GuessStrength, GuessLocation;

std::cin >> GuessDepth >> GuessStrength >> GuessLocation;



//store player guess

int GuessSum = GuessStrength + GuessLocation + GuessDepth;

int GuessProduct = GuessStrength * GuessLocation * GuessDepth;

// Check if they guessed right

if (GuessDepth == Depth && GuessStrength == Strength && GuessLocation == Location)

{

    std::cout << "\n\n Congrats you have begun the process. Are you ready for more?";

    return true;

}



/* if (GuessStrength == Strength && GuessLocation == Location)

{

    std::cout << "Her strength fades. However you have discovered the Strength and the Location. Do you dare try again?";        

}

if  (GuessLocation == Location)

{

    std::cout << "Her strength fades. However you have discovered the Location. Do you dare try again?";        

} */

else

{

    std::cout << " \nHer strength fades. Do you dare try again?";

    return false;

} 

}

int main()

{

int LevelDifficulty = 20;

int const MaxLevelDifficulty = 0;

while (LevelDifficulty >= MaxLevelDifficulty) //Loop until all levels are completed

{

bool bLevelComplete = PlayGame(LevelDifficulty);

std::cin.clear();

std::cin.ignore();

if (bLevelComplete)

{

    --LevelDifficulty;

}

}

std::cout << "Congratulations the princess lives. The king will allow you anything you desire.";

std::cout << "Well done Sir Mage";

return 0;

}

1 Like

Wow lots of detail and attention to your post. Amazing job! :grin:

Privacy & Terms