TripleX Isekai Episode 2

TripleX.cpp

#include <iostream>
using namespace std;    // This allows us to circumvent typing std::

int main()
{
    // Terminal Spacing
    cout << endl;
    cout << "*********" << endl;
    cout << "*TripleX*" << endl;
    cout << "*********" << endl;
    
    cout << endl;

    //Triple X Premise
    cout << "After getting bit by a duck, you are Isekai'ed into an anime...";
    cout << endl;
    cout << "Guess the correct power levels to get noticed by Senpai...\n";
    
    //Initializes the three Power levels
    int CodeA = 4;
    int CodeB = 3;
    int CodeC = 2;

   
    const int CodeSum = CodeA + CodeB + CodeC;         //Sum of variables
    const int CodeProduct = CodeA * CodeB * CodeC;     //Product of variables

    //Print values
    cout << endl;
    cout << "- There are 3 levels that add up to the final power level." << endl;
    cout << "- The Sum of those levels are: ";
    cout << CodeSum << endl;
    cout << "- The Product of those levels are: ";
    cout << CodeProduct << endl;
    cout << endl;
    cout << "Now, guess the 3 power levels..." << endl;

    //Player Guessing Variables
    int GuessA, GuessB, GuessC;
    
    //Get Player Input
    cin >> GuessA;
    cin >> GuessB;
    cin >> GuessC;    
    
    // Calculate Both Sum and Product of Guesses
    int GuessSum = GuessA + GuessB + GuessC;
    int GuessProduct = GuessA * GuessB * GuessC;

    //Conditionals Check the answer against the solution
    if(GuessSum == CodeSum && GuessProduct == CodeProduct)
    {
        cout << "You're guess is correct! Senpai approvingly nods in your direction" << endl;
    }
    else
    {
        cout << "OH NOO! Senpai left! Could this be WRONG ANSWER?" << endl;
    }

    cout << endl;
    return 0;
}

Output:
Section 5 Triple X Terminal Output screenshot 10_tx_uc2

I love the anime references!

1 Like

Privacy & Terms