Nov 04, 2004 11:40
/*This is the MATHULATOR 9000, it tries to do math*/
#include
#include /*include time travel capability*/
/*declare stuff*/
int sel;
int loop;
float num1;
float num2;
float answer;
/*here is the program*/
int main()
{
loop = 0;
srand(time(NULL)); /*Putting clock into the random!*/
/*main menu*/
while (loop == 0){
printf("Welcome to the MATHULATOR 9000\n");
printf("You are using the worlds most advanced number calculating machine\n");
printf("Please enter the type of calculation you would like to perform:\n\n");
printf("1. Combine two numbers... to make one bigger number\n");
printf("2. Remove one number from another number\n");
printf("3. Multiplixicaton!\n");
printf("4. Make a number into a certain number of piles\n");
printf("5. Quantum calculus\n");
printf("6. Exit\n\n");
printf("Make your selection now: ");
scanf("%d", &sel);
/*addition portion*/
if (sel == 1){
printf("Enter the first number you wish to use: ");
scanf("%f", &num1);
printf("Enter the second number to combine with the first: ");
scanf("%f", &num2);
printf("Now Addifying!\n");
answer = num1 + num2 + (rand()%10) - (rand()%10);
if (answer > 1000) answer = answer + (rand()%100) - (rand()%100);
/*answer output*/
if (answer > 0 && answer < 10000) printf("Those two numbers make something near %.0f... or something like that\n", answer);
if (answer < 1) printf("that's like, not anything\n");
if (answer > 9999) printf("The answer is: a lot, like more than four digits or something\n");
if (answer > 1000000) printf("what the hell is wrong with you? trying to make me add numbers like that!\n");
if (answer == 1337) printf("I hate that number!\n");
printf("\n\n\n");
}
/*subtraction portion*/
if (sel == 2){
printf("Enter the first number you wish to use: ");
scanf("%f", &num1);
printf("Enter the second number to take away from the first: ");
scanf("%f", &num2);
printf("Now booleaning!\n");
answer = num1 - num2 + (rand()%10) - (rand()%10);
if (answer > 1000) answer = answer + (rand()%100) - (rand()%100);
/*answer output*/
if (answer > 0 && answer < 10000) printf("That means you have %.0f apples, i mean, uh. numbers \n", answer);
if (answer < 1) printf("Uh, what happens if you run out of numbers to take away?\n");
if (answer > 9999) printf("The answer is: a lot, like more than four digits or something\n");
printf("\n\n\n");
}
/*multiplication portion*/
if (sel == 3){
printf("Enter the first number you wish to use: ");
scanf("%f", &num1);
printf("that number how many times?: ");
scanf("%f", &num2);
printf("Now multiplexoring!\n");
answer = (num1 + (rand()%3) - (rand()%3)) * (num2 + (rand()%3) - (rand()%3));
/*answer output*/
if (answer > 0 && answer < 10000) printf("That's like %.0f, I think\n", answer);
if (answer < 1) printf("How do you have more than one of something you don't have?\n");
if (answer > 9999) printf("The answer is: a lot, like more than four digits or something\n");
printf("\n\n\n");
}
/*division portion*/
if (sel == 4){
printf("Enter the first number you wish to use: ");
scanf("%f", &num1);
printf("How many piles do you want to make?: ");
scanf("%f", &num2);
printf("Now multiplexoring!\n");
/*make sure there is no divide by zero. because that sucks*/
if (num2 != 0){
answer = num1 / num2 + (rand()%10) - (rand()%10);
if (answer > 1000) answer = answer + (rand()%100) - (rand()%100);
/*answer output*/
if (answer > 0 && answer < 10000) printf("That's like %.0f, I think\n", answer);
if (answer < 1) printf("How do you have more than one of something you don't have?\n");
if (answer > 9999) printf("The answer is: a lot, like more than four digits or something\n");
}
if (num2 == 0){
printf("ARE YOU TRYING TO KILL ME OR SOMETHING? BYE!\n\n");
break; /*the program is really pissed off*/
}
printf("\n\n\n");
}
/*quantum calculus*/
if (sel == 5){
printf("\n\nNow cal... Uh, you know, It's been a long time since school and all.\n");
printf("I'm like sort of tired and, well, why don't you just pick a simpler one.\n\n\n");
}
/*exit*/
if (sel == 6) loop = 1;
}
return (0);
}