A look at my code after finishing If and ELSE statements. Added player name input by using std::string and then having the player input that, as well as typing OK to continue to the puzzle to avoid clutter of text all at once.
int main()
{
//cout = characteroutput
//cin = characterinput
//printing out string information to the terminal for context.
std::string PlayerName;
std::string OK = "OK";
//player enters any name of their chosing
std::cout << "ENTER NAME BELOW" << std::endl;
std::cin >> PlayerName;
std::cout << std::endl;
std::cout << "Hello " << PlayerName << ", I want to play a game. You've been cuffed to a radiator.";
std::cout << std::endl; //line space between text.
std::cout << "There's a safe here with a key inside it to let you out of the handcuffs...";
std::cout << std::endl; //line space between text.
std::cout << "You need to solve the riddle to gain the codes in order to unlock this safe and continue to the next step of the game. Don't fail, your life might just depend on it." << std::endl;
//player needs to input "OK" to proceed to the riddle.
std::cout << "Type OK to continue" << std::endl;
std::cin >> OK;
//declare 3 number code
const int CodeA = 2;
const int CodeB = 2;
const int CodeC = 3;
int CodeSum = CodeA + CodeB + CodeC;
int CodeProduct = CodeA * CodeB * CodeC;
//print sum and product to the terminal
std::cout << std::endl;
std::cout << "* There are three numbers in the code" << std::endl;
std::cout << "* The codes add upp to: " << CodeSum << std::endl;
std::cout << "* The codes multiply to: "<< CodeProduct << std::endl;
std::cout << std::endl;
std::cout << "ENTER NUMBER BELOW" << std::endl;
std::cout << std::endl;
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessC;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
//if the Guess Sum and the Guess Product equal to the Code Sum and Code Product, players have beaten part one.
//else, the player has lost.
if (GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << std::endl << "Congratulations " << PlayerName << " you have completed the first part of the game.";
}
else
{
std::cout << std::endl << "Looks like you've lost the game at the very beginning, " << PlayerName <<"... GAME OVER";
}
return 0;
}