Math Problems!
//HERES SOME TIPS BEFORE COPY AND PASTE:
//Pres cntrl and A to copy everything
//Because i run the program with namespace my awesome program, you will have to watch
//Brackeys 1st c# tutorial and download visual studio code to do it.If you run it on an online compiler, you //will have to make changes in
//The namespace.
//If you have a bad computer(that runs from 15 fps and below) you will have to delete some //MathProblem();
//Give credit if video
//You can make changes to the code
//Message me via email (kgiotakos@gmail.com) if you find any problems
//HERES THE CODE:
using System;
namespace My_Awesome_Program
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Math Problems";
Console.WindowHeight = 40;
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("This Game Was Created by GostGK!");
Console.WriteLine("Check GostGK: Instagram/TikTok: @gostgkyt YouTube: GostGK GAMES");
Console.WriteLine("Welcome to Math Problems!");
Console.WriteLine("You will not have to do straight up calculations.");
Console.WriteLine("You will have to mathimatical problems.");
Console.WriteLine("Just like real life.Right?");
Console.WriteLine("Can you beat your own record?Lets find out!\n");
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
mathProblem();
Console.WriteLine("Well,That's the End!");
Console.WriteLine("Hope you had a Great Time!");
Console.WriteLine("As Always,Thanks For Playing!\n");
Console.WriteLine("This Game Was Created by GostGK!");
Console.WriteLine("Check GostGK: Instagram/TikTok: @gostgkyt YouTube: GostGK GAMES");
Console.ReadKey();
}
static void mathProblem()
{
//Random Names
Random NameGenerator1 = new Random();
int NameGen1 = NameGenerator1.Next(1, 5);
string Name1 = "ThisWillNotBeIncluded";
Random NameGenerator2 = new Random();
int NameGen2 = NameGenerator2.Next(1, 5);
string Name2 = "ThisWillNotBeIncluded";
int NameSpecifyGender = 0;
if ( NameGen1 == 1)
{
Name1 = "John";
NameSpecifyGender = NameSpecifyGender + 10000;
}
else if (NameGen1 == 2)
{
Name1 = "Andrew";
NameSpecifyGender = NameSpecifyGender + 10000;
}
else if (NameGen1 == 3)
{
Name1 = "Jack";
NameSpecifyGender = NameSpecifyGender + 10000;
}
else if (NameGen1 == 4)
{
Name1 = "Sophia";
NameSpecifyGender = NameSpecifyGender + 100;
}
else if (NameGen1 == 5)
{
Name1 = "Mary";
NameSpecifyGender = NameSpecifyGender + 100;
}
//RANDOM GENDER SELECTOR AND GENERATOR
string GendGen1 = "ThisWillNotBeIncluded";
if ( NameSpecifyGender > 1000)
{
GendGen1 = " He";
}
else if ( NameSpecifyGender < 1000)
{
GendGen1 = " She";
}
//END OF RANDOM NAME 1 HERE
if ( NameGen2 == 1)
{
Name2 = "Pinapples";
}
else if (NameGen2 == 2)
{
Name2 = "Patatoes";
}
else if (NameGen2 == 3)
{
Name2 = "Strawberries";
}
else if (NameGen2 == 4)
{
Name2 = "Watermellons";
}
else if (NameGen2 == 5)
{
Name2 = "Chocholates";
}
//END OF RANDOM NAME 2 HERE
//RANDOM NUMBERS
Random NumberGen1 = new Random();
int NumGen1 = NumberGen1.Next(1, 10);
Random NumberGen2 = new Random();
int NumGen2 = NumberGen2.Next(1, 10);
Random NumberGen3 = new Random();
int NumGen3 = NumberGen3.Next(1, 10);
//Random Questions
Random QuestionGenerator1 = new Random();
int QuestionGen1 = QuestionGenerator1.Next(1, 5);
string Ques1 = "ThisWillNotBeIncluded";
string QueAnsw1 = "ThisWillNotBeIncluded";
if (QuestionGen1 == 1)
{
Ques1 = "splits it with another person.";
QueAnsw1 = "How many pieces will " + GendGen1 + " has left?";
}
else if (QuestionGen1 == 2)
{
Ques1 = "drops " + NumGen3 + ".";
QueAnsw1 = "How many pieces will " + GendGen1 + " has left?";
}
else if (QuestionGen1 == 3)
{
Ques1 = "gives " + NumGen3 + " to a person.";
QueAnsw1 = "How many pieces will " + GendGen1 + " has left?";
}
else if (QuestionGen1 == 4)
{
Ques1 = "cuts them in half.";
QueAnsw1 = "How many pieces will " + GendGen1 + " has left?";
}
else if (QuestionGen1 == 5)
{
Ques1 = GendGen1 + " " + " has " + NumGen3 + "which are bad";
QueAnsw1 = "How many good " + NumGen3 + " he has left?";
}
//END OF RANDOMS
//SPLIT UNSPLITTPBLEN NUMBERS FIXER
if ( NumGen1 == 9 || NumGen1 == 7 || NumGen1 == 5 || NumGen1 == 3)
{
NumGen1 = NumGen1 + 1;
NumGen3 = NumGen3 + 1;
}
//CUT UNCUTABLE NUMBERS FIXER
if ( NumGen1 == 1)
{
NumGen1 = NumGen1 + 3;
}
//SPECIFY ANSWER
int Answer = 0;
if (QuestionGen1 == 1)
{
Answer = NumGen1 / 2;
}
else if (QuestionGen1 == 2)
{
Answer = NumGen1 - NumGen3;
}
else if (QuestionGen1 == 3)
{
Answer = NumGen1 - NumGen3;
}
else if (QuestionGen1 == 4)
{
Answer = NumGen1 / 2;
}
else if (QuestionGen1 == 5)
{
Answer = NumGen1 * 2;
}
Console.WriteLine("If " + Name1 + " Has" + " " + NumGen1 + " " + Name2 + "," + " and" + " " + Ques1 + QueAnsw1);
int UserAnswer = Convert.ToInt32 (Console.ReadLine());
if ( UserAnswer == Answer )
{
Console.WriteLine("Well Done!");
}
else if ( UserAnswer != Answer )
{
Console.WriteLine("Wrong!The correct answer was: " + Answer + "!");
}
}
}
}
Σχόλια
Δημοσίευση σχολίου