Skip to content
Sudo Arash edited this page Aug 25, 2024 · 2 revisions

๐ŸŽ‰ Welcome to the Extreme Math Wiki! ๐Ÿ“š

Hello, and welcome to the Extreme Math wiki! This is your ultimate go-to source for all the intricate details and mechanics behind the Extreme Math game. Whether you're a seasoned player or a curious newcomer, this wiki is here to elevate your understanding and gameplay experience! ๐Ÿง โœจ


๐Ÿง Why Does This Wiki Exist?

The purpose of this wiki is to provide comprehensive explanations on how the game generates equations and other essential details. Whether you're here to up your game or to contribute your knowledge, this wiki is your playground. ๐ŸŽฎ

Note

โœ๏ธ Contributions are always encouraged! We appreciate and welcome any improvements you can offer to our wiki pages.

๐Ÿš€ How Does the Game Work?

Hereโ€™s a quick overview of how Extreme Math keeps your brain buzzing:

  1. ๐ŸŽฎ Game Menu: The game displays a user-friendly menu (TUI or GUI).
  2. ๐Ÿงฉ Select Equation Type: The game waits for you to choose the type of equation you want to solve.
  3. ๐Ÿ” Generate Equation: The game generates a unique equation and prompts you to solve it.
  4. โœ… Validate Answer: Your answer is validated against the correct one stored in memory.
  5. ๐ŸŽ‰ Feedback: Depending on your answer, you'll get an instant message indicating whether you were correct or not.

๐Ÿง  How Does the Game Generate Equations?

The game generates three types of equations to challenge your mathematical prowess: Simple Linear Equations, Advanced Linear Equations, and for the daring, Quadratic Equations. Letโ€™s dive into how each one is crafted! ๐Ÿ”

โœ๏ธ Simple Linear Equations

The basic form is:

[ ax + b = c ]

Here's how the numbers are rolled out:

  • a: A random number between 1 and 10.
  • b: A random number between 0 and 10.
  • x (Correct Answer): A random number between -10 and 10.

Example Equation:

If a = 2, b = 5, and x = -5, the equation becomes:

[ 2x + 5 = c ]

And solving for c gives:

[ c = ax + b = 2 \times (-5) + 5 = -10 + 5 = -5 ]

Voilร ! The equation is:

[ 2x + 5 = -5 ]

๐ŸŽข Quadratic Equations

For those who love a challenge, quadratic equations come in the form:

[ ax^2 + bx + c = d ]

Hereโ€™s the magic behind generating them:

void generateQuadraticEquation(int& a, int& b, int& c, int& d, int& correctAnswer) {
    logInformation(1, "Generating quadratic equation...");
    
    // Choose a random integer for the correctAnswer
    correctAnswer = getRandomNumber(1, 10);
    
    // Generate coefficients and constants for the quadratic equation
    a = getRandomNumber(1, 5);    // Smaller range for coefficients to simplify
    b = getRandomNumber(1, 5);
    c = getRandomNumber(1, 5);
    
    // Compute the value of d to ensure the equation is solvable
    d = a * correctAnswer * correctAnswer + b * correctAnswer + c;
    
    // Log the generated equation
    logInformation(1, "Generated equation: " + std::to_string(a) + "x^2 + " + std::to_string(b) + "x + " + std::to_string(c) + " = " + std::to_string(d));
}

Explanation:

  1. ๐ŸŽฏ Correct Answer: A random integer between 1 and 10 is chosen.

  2. ๐Ÿ”ข Coefficients: a, b, and c are randomly picked from 1 to 5.

  3. ๐Ÿงฎ Calculate d: Using the formula:
    [ d = a \times \text{{correctAnswer}}^2 + b \times \text{{correctAnswer}} + c ]

  4. Example:
    Given a = 2, b = 3, c = 4, and correctAnswer = 2, you get:
    [ 2x^2 + 3x + 4 = 18 ]

โš–๏ธ Advanced Linear Equations

For those who want to level up, advanced linear equations are in the form:

[ ax + b = cx + d ]

Hereโ€™s how they're created:

void generateAdvancedLinearEquation(int& a, int& b, int& c, int& d, int& correctAnswer) {
    logInformation(1, "Generating advanced linear equation...");
    
    // Generate coefficients for the equation
    a = getRandomNumber(1, 10);    // Coefficient of x on the left side
    c = getRandomNumber(1, 10);    // Coefficient of x on the right side
    b = getRandomNumber(1, 20);    // Constant on the left side
    d = getRandomNumber(1, 20);    // Constant on the right side
    
    // Choose a random solution for x
    correctAnswer = getRandomNumber(1, 10);

    // Compute the value of the right side constant
    int leftSide = a * correctAnswer + b;
    d = leftSide - c * correctAnswer;
    
    // Log the generated equation
    logInformation(1, "Generated equation: " + std::to_string(a) + "x + " + std::to_string(b) + " = " + std::to_string(c) + "x + " + std::to_string(d) + ", Solution: " + std::to_string(correctAnswer));
}

Explanation:

  1. ๐Ÿ”ข Coefficients: a, b, c, and d are generated randomly.

  2. ๐ŸŽฏ Correct Answer: A random integer between 1 and 10 is chosen as the solution.

  3. โš–๏ธ Balance the Equation:
    [ d = a \times \text{{correctAnswer}} + b - c \times \text{{correctAnswer}} ]

  4. Example:
    With a = 3, b = 7, c = 4, and correctAnswer = 2, the equation becomes:
    [ 3x + 7 = 4x + 5 ]

This ensures every equation is challenging yet solvable, keeping the fun and learning alive! ๐ŸŽ‰