3
« on: January 09, 2016, 06:12:58 pm »
I've always been pretty heavily exposed to computers. My dad got into computation back before personal computers and used to program in COBOL, (he's currently a sysadmin for United Launch Alliance) so, I just sort of grew up with it.
Started fucking with them pretty much as soon as I was capable of full coherent functioning and at a pretty early age I used to find ways inside my parents computer (by sheer force of curiosity and tinkering with shit, I guess.) Didn't do much of anything, just sort of moved things around, deleted files, created files, and generally fucked shit up, but that sort of got the ball rolling.
At around 12 my dad got me a copy of RHEL and a book on C that was very much not geared towards someone my age and left me to my own devices with it. Absolutely loved it; learned how to work the terminal and started doing absolutely everything I could through it while I was learning to code. Enjoyed the fuck out of that for a while, but at some point it fell off. Really wish I'd stuck with it then. But the spark has very much been rekindled.
Recently came across a piece of code I wrote back then... It's pretty horrible, but I was 12 and only had about 6 chapters of C under my belt with no other experience. Just over 1000 lines, all in a single gigantic function. Hah....
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>
#include <time.h>
int main(void)
{
char line[100];
int HP = 1000;
int MAXHP = 1000;
int ATTACK = 3;
int room = 0;
int level = 1;
float gold = 0;
int exp = 0;
int maxexp = 0;
int DEFENCE = 3;
int MOBHP = 1000;
int MOBATTACK = 3;
int MOBDEFENCE = 3;
int MINHIT = 0;
int MAXHIT = 0;
int MOBMIN = 0;
int MOBMAX = 0;
int MAXHITX = 0;
int MOBMAXX = 0;
int choose = 0;
int hit = 0;
char BLANK = 0;
time_t now = 0;
char choosechar;
/*RANDOM ITEMS*/
int bladeofwrath = 0;
int explosivegoo = 0;
/*Equipment*/
int weapon = 0;
char weaponname[20];
int armour = 0;
char armourname[20];
armour = 1;
weapon = 1;
armourname[0] = 'T';
armourname[1] = 'a';
armourname[2] = 't';
armourname[3] = 't';
armourname[4] = 'e';
armourname[5] = 'r';
armourname[6] = 'e';
armourname[7] = 'd';
armourname[8] = ' ';
armourname[9] = 'C';
armourname[10] = 'l';
armourname[11] = 'o';
armourname[12] = 't';
armourname[13] = 'h';
armourname[14] = ' ';
armourname[15] = ' ';
armourname[16] = ' ';
armourname[17] = ' ';
armourname[18] = ' ';
armourname[19] = ' ';
weaponname[0] = 'F';
weaponname[1] = 'i';
weaponname[2] = 's';
weaponname[3] = 't';
weaponname[4] = 's';
weaponname[5] = ' ';
weaponname[6] = ' ';
weaponname[7] = ' ';
weaponname[8] = ' ';
weaponname[9] = ' ';
weaponname[10] = ' ';
weaponname[11] = ' ';
weaponname[12] = ' ';
weaponname[13] = ' ';
weaponname[14] = ' ';
weaponname[15] = ' ';
weaponname[16] = ' ';
weaponname[17] = ' ';
weaponname[18] = ' ';
weaponname[19] = ' ';
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\n\n\nYou don't know where you are or how you got here..........\n\n\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\n\n\nYou don't know why you are here..........\n\n\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\n\n\nYou slowly wake up..........\n\n\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
Room:
{
printf("\n\n\n\n N\n ");
printf(" /-----\\\n / # \\\n :::::An o");
printf("gres cave::::: | # |\n | @");
printf(" | \n | |\n ");
printf(" \\ /\n \\-----/\n ");
printf(" \n\nYou are in a cave, you don't know how y");
printf("ou got here.\nBut what you do know is a huge ogre is standing right next");
printf(" to you,\nstaring at you.\nWill you stay and fight or try to run?\n\n ");
printf(" Exits: North(N)\n Other options: Attack the ogre!(");
printf("A)\n\n");
printf(" (Type 'H' for a list of commands.)\n\n\n");
RoomCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'A': case 'a':
goto BattleA_Huge_Ogre;
case 'N': case 'n':
goto Run;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto RoomCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto RoomCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto RoomCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto RoomCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto RoomCommand;
}
case'O': case'o':
{
goto Room;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Room;
}
}
}
Room1:
{
printf("\n\n\n\n N\n ");
printf(" /-----\\\n / # \\\n :::::An o");
printf("gres cave::::: | # |\n | @");
printf(" | \n | |\n ");
printf(" \\ /\n \\-----/\n ");
printf(" \n\nYou are in a cave.\n\n");
printf(" Exits: North(N)");
printf("\n\n\n");
Room1Command:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'N': case 'n':
goto Room2;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto Room1Command;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto Room1Command;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto Room1Command;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto Room1Command;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto Room1Command;
}
case'O': case'o':
{
goto Room1;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Room1;
}
}
}
Room2:
{
printf("\n\n\n N\n /-----\\\n ");
printf(" / # \\\n :::::Outside the ogres cave::::: | # |\n W |###@###| E\n ");
printf(" | # |\n \\ # /\n \\-----/\n ");
printf(" S\n\nYou are outside of the ogres cave, you have successfully beaten ");
printf("him.\nYou are in the middle of nowhere in the mounta");
printf("ins.\nThere is a large glowing crystal on a rock.");
if(HP <= 100)
{
printf("\nBlood drips from a large wound in your side.");
}
printf("\nWhat will you do now?\n\n Exits: North(N), East(E), South(S), West(W).");
printf(" \n Other options: Touch the crystal(T)\n\n\n");
Room2Command:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'N': case 'n':
{
switch(explosivegoo)
{
case 1:
goto Insectking2;
default:
goto Insectking;
}
}
case 'E': case 'e':
{
switch(bladeofwrath)
{
case 1:
goto Bladeofwrath2;
default:
goto Bladeofwrath;
}
}
case 'W': case 'w':
goto Steeprockypass;
case 'S': case 's':
goto Room1;
case 'T': case 't':
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou touch the crystal and it heals you fully!\n");
HP = MAXHP;
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Room2;
}
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto Room2Command;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto Room2Command;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto Room2Command;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto Room2Command;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto Room2Command;
}
case'O': case'o':
{
goto Room2;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Room2;
}
}
}
Run:
{
printf("\n\nYou: RUN AWAY!!! O.O\n*You run away*\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("A Huge Ogre has caught you and torn you in two!\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Dead;
}
Dead:
{
printf("\n\nYou drift into death...");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nBlackness takes over...\n");
fgets(line,sizeof(line),stdin);
Deader:
sscanf(line,"%c", &BLANK);
goto Deader;
}
Death:
{
printf("\n\nYou drift into death...");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nBlackness takes over...\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
}
Insectking:
{
printf("\n\n\n\n \n /-----\\\n ");
printf(" / \\\n :::::The insect king::::: | |\n | @ | \n ");
printf(" | # |\n \\ # /\n \\-----/\n ");
printf(" S\n\nYou are in a crypt, rotting skeletons are covering the ground almost entirely.\nThere is a foul s");
printf("tench in the air, it wreaks of decay.\nInfront of you stands the biggest preying mantis you have ever seen!\nHe looks at you with ");
printf("a face you don't quite understand.\n\n Exits: South(S)\n Other options: Attack the insect king!(A)\n\n\n");
InsectkingCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'S': case 's':
goto Room2;
case 'A': case 'a':
{
MOBHP = 10000000;
MOBATTACK = 9;
goto BattleInsect_King;
}
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto InsectkingCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto InsectkingCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto InsectkingCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto InsectkingCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto InsectkingCommand;
}
case'O': case'o':
{
goto Insectking;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Insectking;
}
}
}
Insectking2:
{
printf("\n\n\n\n \n /-----\\\n ");
printf(" / \\\n :::::Empty crypt::::: | |\n | @ | \n ");
printf(" | # |\n \\ # /\n \\-----/\n ");
printf(" S\n\nYou are in a crypt, rotting skeletons are covering the ground almost entirely.\nThere");
printf(" is a foul stench in the air, it wreaks of decay.\n\n Exits: South(S)\n\n\n");
Insectking2Command:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'S': case 's':
goto Room2;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto Insectking2Command;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto Insectking2Command;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto Insectking2Command;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto Insectking2Command;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto Insectking2Command;
}
case'O': case'o':
{
goto Insectking2;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Insectking2;
}
}
}
Bladeofwrath:
{
printf("\n\n\n\n \n /-----\\\n ");
printf(" / \\\n :::::The blade of wrath!::::: | |\n W |###@ | \n ");
printf(" | |\n \\ /\n \\-----/\n ");
printf(" \n\nInfront of you lays the legendary blade of wrath.\nThe blade shimmers in the faint light of the cave se");
printf("eming to\nilluminate the room with a beutifull, yet evil glow.\n\n Exits: West(W)\n Other options: Take th");
printf("e blade of wrath!(B)\n\n\n");
BladeofwrathCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'W': case 'w':
goto Room2;
case 'B': case 'b':
{
weapon = 80000;
weaponname[0] = 'B';
weaponname[1] = 'l';
weaponname[2] = 'a';
weaponname[3] = 'd';
weaponname[4] = 'e';
weaponname[5] = ' ';
weaponname[6] = 'o';
weaponname[7] = 'f';
weaponname[8] = ' ';
weaponname[9] = 'W';
weaponname[10] = 'r';
weaponname[11] = 'a';
weaponname[12] = 't';
weaponname[13] = 'h';
weaponname[14] = ' ';
weaponname[15] = ' ';
weaponname[16] = ' ';
weaponname[17] = ' ';
weaponname[18] = ' ';
weaponname[19] = ' ';
bladeofwrath = 1;
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou take the blade of wrath! You feel its powers rushing through your veins!\n(+80,000 attack power)\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Bladeofwrath2;
}
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto BladeofwrathCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto BladeofwrathCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto BladeofwrathCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto BladeofwrathCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto BladeofwrathCommand;
}
case'O': case'o':
{
goto Bladeofwrath;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Bladeofwrath;
}
}
}
Bladeofwrath2:
{
printf("\n\n\n\n \n /-----\\\n ");
printf(" / \\\n :::::A cave::::: | |\n W |###@ | \n ");
printf(" | |\n \\ /\n \\-----/\n ");
printf(" \n\nYou are in a completely empty cave!\n\n Exits: West(W)\n");
printf("\n\n\n");
Bladeofwrath2Command:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'W': case 'w':
goto Room2;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto Bladeofwrath2Command;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto Bladeofwrath2Command;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto Bladeofwrath2Command;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto Bladeofwrath2Command;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto Bladeofwrath2Command;
}
case'O': case'o':
{
goto Bladeofwrath2;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Bladeofwrath2;
}
}
}
Steeprockypass:
{
printf("\n\n\n\n \n /-----\\\n ");
printf(" / \\\n :::::A rockslide::::: | |\n | @###| E\n ");
printf(" | |\n \\ /\n \\-----/\n ");
printf(" \n\nA rockslide appears to have blocked this path off.\n\n Exits: East(E)\n Othe");
printf("r options: Blow up the wall!(B)(Requires Explosive Goo)\n\n\n");
SteeprockypassCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'E': case 'e':
goto Room2;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto SteeprockypassCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto SteeprockypassCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto SteeprockypassCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto SteeprockypassCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto SteeprockypassCommand;
}
case'O': case'o':
{
goto Steeprockypass;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Steeprockypass;
}
case 'B': case 'b':
switch(explosivegoo)
{
case 1:
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\n*!!!BOOM!!!*");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou blow a hole in the wall and walk through.\n");
printf("*!!!THE WALL COLLAPES!!!\a*");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Darkroom;
}
default:
{
printf("\nYou cant do that!\a\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Steeprockypass;
}
}
}
Darkroom:
{
printf("\n\n\n\n \n /-----\\\n");
printf(" /#######\\\n :::::Dark cave::::: |#######|\n |#######| \n");
printf(" |#######|\n \\#######/\n \\-----/\n");
printf(" \n\nThere is a faint light glowing, You don't know where it's coming from.\nIt is cold and damp.\n\n");
printf(" Exits: If there are any, you can't see them.\n\n\n");
DarkroomCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'W': case 'w':
goto Dimroom;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto DarkroomCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto DarkroomCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto DarkroomCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto DarkroomCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto DarkroomCommand;
}
case'O': case'o':
{
goto Darkroom;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Darkroom;
}
}
}
Dimroom:
{
printf("\n\n\n\n \n /-----\\\n");
printf(" / \\\n :::::Dim cave::::: | |\n | @###| E\n");
printf(" | |\n \\ /\n \\-----/\n");
printf(" \n\nThere is a faint light, You don't know where it's coming from.\nIt is cold and damp.\n\n");
printf(" Exits: East(E)\n\n\n");
DimroomCommand:
printf("\n");
fgets(line,sizeof(line),stdin);
sscanf(line,"%c", &choosechar);
switch(choosechar)
{
case 'E': case 'e':
goto Darkroom;
case 'H': case 'h':
{
printf("\n\n\nCommands:\nThis menu(H)\nLook(O)\nHow much gold you have(G)\nYour stats(Y)\nYour items(I)\nExpirience(L)\n\n\n");
goto DimroomCommand;
}
case 'G': case 'g':
{
printf("\n\n\nYou currently have %f gold.\n\n\n", gold);
goto DimroomCommand;
}
case 'Y': case 'y':
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
printf("\n\n\n\nYour stats:\n\n");
printf(" Level: %d\n\n Attack: %d\n\n Defence: %d\n\n Damage: %d-%d\n\n\n", level, ATTACK, DEFENCE, MINHIT, MAXHIT);
goto DimroomCommand;
}
case 'I': case 'i':
{
printf("\n\n\nWeapon: %s\n Weapon Attack Power: %d\n\nArmour: %s\n Armour Defence Power %d\n\n\n",weaponname ,weapon ,armourname ,armour);
goto DimroomCommand;
}
case 'L': case 'l':
{
printf("\n\n\nLevel: %d | Exp: %d | Exp to level : %d\n\n\n", level, exp, maxexp * maxexp * 100 / 7 * 10 - exp);
goto DimroomCommand;
}
case'O': case'o':
{
goto Dimroom;
}
default:
{
printf("\n\n\nInvalid command!\n\n\n\a");
goto Dimroom;
}
}
}
/*##########################################################################################################*/
/*#################################################@@@@@@@##################################################*/
/*##############@@###########@@######@@@@@@@#######@@@@@@@@@################################################*/
/*##############@@@#########@@@#####@@@@@@@@@######@@@####@@@###############################################*/
/*##############@@@@@#####@@@@@####@@@#####@@@#####@@@#####@@###############################################*/
/*##############@@@@@@###@@@@@@####@@#######@@#####@@@###@@@@###############################################*/
/*##############@@@#@@###@@#@@@###@@@#######@@@####@@@@@@@@@################################################*/
/*##############@@@#@@@#@@@#@@@###@@@#######@@@####@@@@@@@@@################################################*/
/*##############@@@##@@@@@##@@@###@@@#######@@@####@@@###@@@@###############################################*/
/*##############@@@###@@@###@@@####@@#######@@#####@@@#####@@###############################################*/
/*##############@@@####@####@@@####@@@#####@@@#####@@@####@@@###############################################*/
/*##############@@@#########@@@#####@@@@@@@@@######@@@@@@@@@################################################*/
/*##############@@@#########@@@######@@@@@@@#######@@@@@@@##################################################*/
/*##########################################################################################################*/
BattleA_Huge_Ogre:
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
MOBMIN = MOBATTACK * 44;
MOBMAX = MOBATTACK * 66;
MAXHITX = MAXHIT - MINHIT;
MOBMAXX = MOBMAX - MOBMIN;
maxexp *= maxexp * 100 / 7 * 10;
BattleA_Huge_OgreATTACK:
{
if(MOBHP >= 0)
{
hit = (MINHIT + rand()%MAXHITX) - (MOBDEFENCE * 33);
printf("\nYou have just hit A Huge Ogre for: %d\n", hit);
MOBHP = MOBHP - hit;
printf("\n\nYour HP: %d", HP);
printf("\nA Huge Ogres HP: %d\n\n", MOBHP);
if(MOBHP <= 0)
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou have successfully killed A Huge Ogre!\n");
printf("\nYou gain 250 exp and 50 gold\n");
exp = exp + 250;
gold = gold + 50;
if(exp >= maxexp)
{
level = level + 1;
exp = 0;
printf("You leveled up! You are now level %d", level);
ATTACK = ATTACK + (level * 0.046);
}
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Room1;
}
else
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto BattleA_Huge_OgreDEFENCE;
}
}
else
printf("\nYou have successfully killed A Huge Ogre!\n");
goto Room2;
}
BattleA_Huge_OgreDEFENCE:
{
if(HP >= 0)
{
hit = (MOBMIN + rand()%MOBMAXX) - (DEFENCE * 33);
printf("\nA Huge Ogre hits you for: %d\n", hit);
HP = HP - hit;
printf("\n\nYour HP: %d", HP);
printf("\nA Huge Ogres HP: %d\n\n", MOBHP);
if(HP <= 0)
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou have died!\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Dead;
}
else
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto BattleA_Huge_OgreATTACK;
}
}
else
printf("\nYou have died!\n");
goto Dead;
}
}
BattleInsect_King:
{
MINHIT = (ATTACK + weapon) * 44;
MAXHIT = (ATTACK + weapon) * 66;
MOBMIN = MOBATTACK * 44;
MOBMAX = MOBATTACK * 66;
MAXHITX = MAXHIT - MINHIT;
MOBMAXX = MOBMAX - MOBMIN;
maxexp *= maxexp * 100 / 7 * 10;
BattleInsect_KingATTACK:
{
if(MOBHP >= 0)
{
hit = (MINHIT + rand()%MAXHITX) - (MOBDEFENCE * 33);
printf("\nYou have just hit Insect King for: %d\n", hit);
MOBHP = MOBHP - hit;
printf("\n\nYour HP: %d", HP);
printf("\nInsect Kings HP: %d\n\n", MOBHP);
if(MOBHP <= 0)
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou have successfully killed Insect King!\n");
printf("\nYou gain 500 exp and 100 gold\n");
exp = exp + 500;
gold = gold + 100;
if(exp >= maxexp)
{
level = level + 1;
exp = 0;
printf("\n\n\nYou just advanced a level! You are now level: %d", level);
ATTACK = ATTACK + (level * 0.046);
}
explosivegoo = 1;
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou have just gained \"Explosive goo!\"");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Insectking2;
}
else
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto BattleInsect_KingDEFENCE;
}
}
else
printf("\nYou have successfully killed A Huge Ogre!\n");
goto Room2;
}
BattleInsect_KingDEFENCE:
{
if(HP >= 0)
{
hit = (MOBMIN + rand()%MOBMAXX) - (DEFENCE * 33);
printf("\nInsect King hits you for: %d\n", hit);
HP = HP - hit;
printf("\n\nYour HP: %d", HP);
printf("\nInsect Kings HP: %d\n\n", MOBHP);
if(HP <= 0)
{
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
printf("\nYou have died!\n");
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto Dead;
}
else
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
now = clock();
for( ;clock() - now < CLOCKS_PER_SEC; );
goto BattleInsect_KingATTACK;
}
else
printf("\nYou have died!\n");
goto Dead;
}
}
}
}