#include <iostream>
int main()
{
//Story of the Dragonborn
std::cout << "\n" "Hello Adventurer! \n\n";
std::cout << "+ You have been caught by the Imperials at the Pale pass.\n";
std::cout << "+ Then you were brought to Helgen to execute alongside with Ulfric Stormcloak. \n";
std::cout << "+ While the execution, a dragon came and unleashed its fury on Helgen. \n";
std::cout << "+ A soldier named Hadvar helped you to escape while the dragon attacked. \n";
std::cout << "+ Now you have to unlock the door of the Helgen keep to escape from the dragonfire. \n\n";
/*This
is a multiline comment*/
const int CodeA = 4;
const int CodeB = 3;
const int CodeC = 2;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
std::cout << "++ The door has 3 numbered rune lock. \n";
std::cout << "++ You must insert the correct combination of numbers to unlock the door. \n";
std::cout << "++ You only have one try at this. \n";
std::cout << "++ Here are the hints. \n \n";
std::cout<< "The numbers add up to: " << CodeSum << "\n";
std::cout<< "The numbers multiply to give: "<< CodeProduct << "\n";
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessC;
//std::cout << "You entered: " << GuessA << " " << GuessB << " " << GuessC;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
if (GuessSum == CodeSum && GuessProduct== CodeProduct)
{
std::cout << "Good work. You entered the correct combination of numbers and unlocked the door.";
}
else
{
std::cout << "Wrong combination! The dragon got you.";
}
return 0;
}
1 Like
This is so cool. I love Skyrim!!
1 Like
Thanks