# TripleX Progress (Lesson 24)

This is what I have thus far. Not sure if this is how we’re supposed to show work, or if there’s a master topic somewhere I can’t find we’re supposed to post into.

``````#include <iostream>

int main()
{
// Print out intro story text
std::cout << "You are a half-elf thief stuck in a maze with only one apparent egress.";
std::cout << std::endl;
std::cout << "You will need to enter the correct code to leave." << std::endl;

// Declare 3 number code
const int CodeA = 4;
const int CodeB = 6;
const int CodeC = 7;

const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;

// Print sum and product to terminal
std::cout << std::endl;
std::cout << "+ There are 3 dials on the wall" << std::endl;
std::cout << "+ The dials add up to: " << CodeSum << std::endl;
std::cout << "+ The dials multiply to give: " << CodeProduct << 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 (GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << "The exit clicks open and you are able to leave." << std::endl;
}

else
{
std::cout << "You hear gears slowly whir as the ceiling slowly collapses upon you." << std::endl;
std::cout << "Water washes away your remains as the room readies itself for the next user." << std::endl;
}

return 0;
}
``````

And here’s my sort of meh ascii art, but I did figure out how to escape the escape character.

``````void PrintIntroduction()
{
std::cout << "You are a half-elf thief stuck in a maze with only one apparent egress.\n";
std::cout << "You will need to enter the correct code to leave.\n";
std::cout << "______  ______  ______\n";
std::cout << "|\\  /|  |\\  /|  |\\  /|\n";
std::cout << "| \\/ |  | \\/ |  | \\/ |\n";
std::cout << "| /\\ |  | /\\ |  | /\\ |\n";
std::cout << "|/  \\|  |/  \\|  |/  \\|\n";
std::cout << "______  ______  ______\n";
}

``````