-
Notifications
You must be signed in to change notification settings - Fork 1
Home
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! ๐ง โจ
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.
Hereโs a quick overview of how Extreme Math keeps your brain buzzing:
- ๐ฎ Game Menu: The game displays a user-friendly menu (TUI or GUI).
- ๐งฉ Select Equation Type: The game waits for you to choose the type of equation you want to solve.
- ๐ Generate Equation: The game generates a unique equation and prompts you to solve it.
- โ Validate Answer: Your answer is validated against the correct one stored in memory.
- ๐ Feedback: Depending on your answer, you'll get an instant message indicating whether you were correct or not.
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! ๐
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 ]
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:
-
๐ฏ Correct Answer: A random integer between 1 and 10 is chosen.
-
๐ข Coefficients:
a
,b
, andc
are randomly picked from 1 to 5. -
๐งฎ Calculate
d
: Using the formula:
[ d = a \times \text{{correctAnswer}}^2 + b \times \text{{correctAnswer}} + c ] -
Example:
Givena = 2
,b = 3
,c = 4
, andcorrectAnswer = 2
, you get:
[ 2x^2 + 3x + 4 = 18 ]
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:
-
๐ข Coefficients:
a
,b
,c
, andd
are generated randomly. -
๐ฏ Correct Answer: A random integer between 1 and 10 is chosen as the solution.
-
โ๏ธ Balance the Equation:
[ d = a \times \text{{correctAnswer}} + b - c \times \text{{correctAnswer}} ] -
Example:
Witha = 3
,b = 7
,c = 4
, andcorrectAnswer = 2
, the equation becomes:
[ 3x + 7 = 4x + 5 ]
This ensures every equation is challenging yet solvable, keeping the fun and learning alive! ๐