Ranking
Original Post
I herd u leik coding?
Or maybe you don't.
Whatever, I made this so I could dump my projects on you, and maybe you can share yours too!
-----------------------
As I hope you know, I'm a real newbie noob when it comes to programming, and the only language I can write is C++ (and therefore some C# too).
#1:
I made a game, it took me about 2 days to do and it's not finished, I've also DUMPED this project because it is poorly structured and is inefficient.
I'm currently remaking it all snazzy like, so I might post that once it's done. This code should actually work, but like I said, the game is not finished.
The basic plot is nothing really, Joe Weller is a kid at our school who no-one likes, and The General, Pears and Menergy are little memes me and kill1704 have.
Don't go reading for the cheat button before you play the game you hackers!
Please note, once Pears comes into play, the game loops endlessly, so have fun with that.
C++ code:
#include <iostream>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <conio.h>
#include <ctime>
#include <Windows.h>

using namespace std;
using std::string;

int UserHP = 100;
int EnemyHP = 150;
int iDamageToEnemy;
int iDamage = rand() % 20 + 10;
bool apples = true;
bool piez = true;
int g = 1;
int p = 1;
int e = 1;
int m;
int v = 0;
int iLifeUp = 0;
int iJoeAttack = 10;
int iLewisHealth = 50;
int NoLewis = 0;
int iGeneral;
int iGeneralAttack = 0;
int GeneralHealth = 250;
int PearsHealth = 150;
int PearsAttack = 5;
string iPlayersName;

int GeneralPears ()
{
	//Game loop for you and Pears vs The General
	system("cls");
	cout << "Pears threw you some Menergy!" << endl;
	Sleep (1500);
	system("cls");
	cout << "+70 HP" << endl;
	Sleep(250);
	UserHP += 25;
	Sleep(250);
	UserHP += 25;
	Sleep(250);
	UserHP += 25;
	Sleep(250);
	system("cls");
	if (iLifeUp > 2)
	{
		cout << "Plus " << iLifeUp / 2 << " recovers!" << endl;
		iLifeUp = iLifeUp / 2;
	}
	Sleep(1000);
	UserHP = 100;
	system("cls");
	do {
		cout << "a = attack, r = recover(" << iLifeUp << "/10)" << endl;
		cout << "You: " << UserHP << "Pears: " << PearsHealth << "   " << "The General: " << GeneralHealth << endl;
		char l;
		cin >> l;
		switch (l)
		{
		case 'a':
		case 'A':
			cout << "You attack!" << endl;
			Sleep(500);
			GeneralHealth -= iDamage;
			break;
		case 'r':
		case 'R':
			if (iLifeUp < 10)
			{
				cout << "Recover!" << endl;
				Sleep(500);
				UserHP += 20;
				++iLifeUp;
			} else {
				cout << "Can't recover!" << endl;
			}
			break;
		case 'l':
		case 'L':
			cout << "!OMG SEECRIT POWUR!" << endl;
			Sleep(250);
			do {
			GeneralHealth -= 20;
			cout << "!OMG SEECRIT POWUR!" << endl;
			cout << "The General: " << GeneralHealth << endl;
			system("cls");
			}while (EnemyHP > -100);
			break;
		default:
			cout << "Invalid Move!" << endl;
		}
		system("cls");

		if (PearsHealth > 0)
		{
			int f = rand() % 2;

		}

		if (GeneralHealth > 20)
		{
			int iSoldier = 0;
			int k = rand() % 5;
			int a = rand() % 10;
			if (k <= 1)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General laughed manically!" << endl;
				Sleep(750);
				GeneralHealth += 10;
			} else if (k = 2)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General gave you The Look of Recruitment!!!" << endl;
				Sleep(750);
				if (a <= 3)
				{
					cout << "You were caught in his gaze!" << endl;
					UserHP -= 45 + iGeneralAttack;
					Sleep(500);
				}else 
				{
					cout << "You managed to look away in time!" << endl;
					Sleep(500);
				}
			} else if (k = 3)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used his combat knife!" << endl;
				Sleep(750);
				if (a <= 4)
				{
					cout << "You dodged it!" << endl;
					Sleep(400);
				} else
				{
					UserHP -= 10 + iGeneralAttack;
				}
			} else if (k = 4)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used a stimpack!" << endl;
				Sleep(500);
				cout << "His attack power is raised!" << endl;
				Sleep(750);
				iGeneralAttack += 5;
			} else if (k = 5)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General fired his Heavy Bazooka!" << endl;
				Sleep(750);
				int iBazooka = rand() % 9;
				if (iBazooka <= 1)
				{
					cout << "You were hit!" << endl;
					Sleep(500);
					UserHP -= 45;
					PearsHealth -= 45;
				} else if (iBazooka > 1)
				{
					cout << "A near miss!" << endl;
					Sleep(500);
				}
			}
			system("cls");
		}
		if (UserHP < 1)
		{
			cout << "You have been recruited by The General and turned into Joe Weller, Game Over" << endl;
			return 0;
		}
		}while(GeneralHealth > 1);

		if (GeneralHealth < 1)
		{
			cout << "!!!YOU WIN!!!" << endl;
			return 0;
		}if (UserHP < 1)
		{
			cout << "You have been recruited by The General and turned into Joe Weller, Game Over" << endl;
			return 0;
		}
	return 0;
	}

int Generalandsoldier ()
{
	//Game loop for you vs The General and a Soldier
	int SoldierHealth = 75;
	int iIncriment = 0;
	system("cls");
	do {
		cout << "a = attack, r = recover(" << iLifeUp << "/10)" << endl;
		cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
		char l;
		cin >> l;
		switch (l)
		{
		case 'a':
		case 'A':
			cout << "You attack!" << endl;
			Sleep(500);
			SoldierHealth -= iDamage;
			break;
		case 'r':
		case 'R':
			if (iLifeUp < 10)
			{
			cout << "Recover!" << endl;
			Sleep(500);
			UserHP += 20;
			++iLifeUp;
			} else {
				cout << "Can't recover!" << endl;
			}
			break;
		case 'l':
		case 'L':
			cout << "!OMG SEECRIT POWUR!" << endl;
			Sleep(250);
			do {
			GeneralHealth -= 20;
			cout << "!OMG SEECRIT POWUR!" << endl;
			cout << "The General " << GeneralHealth << endl;
			system("cls");
			}while (GeneralHealth > -100);
			break;
		default:
			cout << "Invalid Move!" << endl;
		}
		system("cls");

		if (GeneralHealth > 20)
		{
			system("cls");
			int iSoldier = 0;
			int k = rand() % 16;
			int a = rand() % 10;
			if (k < 4)
			{
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General laughed manically!" << endl;
				Sleep(750);
				GeneralHealth += 10;
			} else if (k > 4 && k < 7)
			{
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General gave you The Look of Recruitment!!!" << endl;
				Sleep(750);
				if (a <= 3)
				{
					cout << "You were caught in his gaze!" << endl;
					Sleep(500);
					UserHP -= 45 + iGeneralAttack;
				}else 
				{
					cout << "You managed to look away in time!" << endl;
					Sleep(500);
				}
			} else if (k > 7 && k < 11)
			{
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used his combat knife!" << endl;
				Sleep(750);
				if (a <= 4)
				{
					cout << "You dodged it!" << endl;
					Sleep(400);
				} else
				{
					UserHP -= 10 + iGeneralAttack;
				}
			} else if (k > 11 && k < 14)
			{

				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used a stimpack!" << endl;
				Sleep(500);
				cout << "His attacks power is raised!" << endl;
				Sleep(500);
				iGeneralAttack += 5;
			} else if (k > 14)
			{
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General started talking about Call of Duty!" << endl;
				Sleep(500);
				UserHP -= 5;
				GeneralHealth += 5;
			}
		}
		system("cls");

		//While the Soldier is alive, -1  health plus iIncriment's value.
		//iIncriment increases by 1 every time this is looped.
		if (SoldierHealth > 1)
		{
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
			cout << "You: " << UserHP << "   " << "Soldier: " << SoldierHealth << "   " << "The General: " << GeneralHealth << endl;
			Sleep(100);
			cout << "Soldier attacks!" << endl;
			Sleep(500);
			UserHP -= 1 + iIncriment;
			++iIncriment;
		}

		system("cls");
		if (UserHP < 1)
		{
			cout << "You have been recruited by The General and turned into Joe Weller, Game Over" << endl;
			return 0;
		}
		}while(SoldierHealth > 1);
	return 0;
}

int GeneralBattle ()
{
	//You vs The General
	system("cls");
	iLifeUp = 0;
	cout << "Health recovered!" << endl;
	Sleep(1000);
	UserHP = 100;
	system("cls");
	do {
		cout << "a = attack, r = recover(" << iLifeUp << "/10)" << endl;
		cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
		char l;
		cin >> l;
		switch (l)
		{
		case 'a':
		case 'A':
			cout << "You attack!" << endl;
			Sleep(500);
			GeneralHealth -= iDamage;
			break;
		case 'r':
		case 'R':
			if (iLifeUp < 10)
			{
			cout << "Recover!" << endl;
			Sleep(500);
			UserHP += 20;
			++iLifeUp;
			} else {
				cout << "Can't recover!" << endl;
			}
			break;
		case 'l':
		case 'L':
			cout << "!OMG SEECRIT POWUR!" << endl;
			Sleep(250);
			do {
			GeneralHealth -= 20;
			cout << "!OMG SEECRIT POWUR!" << endl;
			cout << "The General: " << GeneralHealth << endl;
			system("cls");
			}while (GeneralHealth > -100);
			break;
		default:
			cout << "Invalid Move!" << endl;
		}
		system("cls");

		if (GeneralHealth > 20)
		{
			int iSoldier = 0;
			int k = rand() % 16;
			int a = rand() % 10;
			if (k < 4)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General laughed manically!" << endl;
				Sleep(750);
				GeneralHealth += 10;
			} else if (k > 4 && k <= 7)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General gave you The Look of Recruitment!!!" << endl;
				Sleep(750);
				if (a <= 3)
				{
					cout << "You were caught in his gaze!" << endl;
					UserHP -= 45 + iGeneralAttack;
					Sleep(500);
				}else 
				{
					cout << "You managed to look away in time!" << endl;
					Sleep(500);
				}
			} else if (k > 7 && k <= 11)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used his combat knife!" << endl;
				Sleep(750);
				if (a <= 4)
				{
					cout << "You dodged it!" << endl;
					Sleep(400);
				} else
				{
					UserHP -= 10 + iGeneralAttack;
				}
			} else if (k > 11 && k <= 14)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General used a stimpack!" << endl;
				Sleep(500);
				cout << "His attack power is raised!" << endl;
				Sleep(750);
				iGeneralAttack += 5;
			} else if (k > 14)
			{
				system("cls");
				cout << "a = attack, r = recover(" << iLifeUp << "/6)" << endl;
				cout << "You: " << UserHP << "   " << "The General: " << GeneralHealth << endl;
				cout << "The General summoned a soldier to help him!" << endl;
				Sleep(1000);
				iSoldier = Generalandsoldier ();
			}
			system("cls");
		}

		int applepie = 1;
		if (UserHP < 1 && applepie < 2)
		{
			UserHP = 1;
			++ applepie;
		} else if (UserHP < 1 && applepie > 1)
		{
			cout << "You have been recruited by The General and turned into Joe Weller, game over" << endl;
		}

		//If users HP is below 20, run this monologue and move to 'GeneralPears'.
		if (UserHP < 20)
		{
			system("cls");
			Sleep(500);
			cout << "General: The battle is hopeless, you can't defeat me!" << endl;
			Sleep(3000);
			cout << "General: I'll finish you with this!" << endl;
			Sleep(2500);
			cout << "The General used his combat knife!" << endl;
			Sleep(1000);
			system("cls");
			cout << "The knife was deflected! By..." << endl;
			Sleep(1000);
			cout << "Pears: You won't win this battle General, I'll make sure of it!" << endl;
			Sleep(2500);
			system("cls");
			cout << "Pears joins you in the battle against The General!" << endl;
			Sleep(2500);
			int t;
			t = GeneralPears();
		}
		}while(GeneralHealth > 1);

		if (GeneralHealth < 1)
		{
			cout << "!!!YOU WIN!!!" << endl;
			return 0;
		}
	return 0;
}

int General ()
{
	//Monologue before battling The General
	cout << "You watched as the terrible visage of Joe burned away into nothingness," << endl;
	Sleep(1000);
	cout << "surely the battle had been won..." << endl;
	Sleep(2500);
	system("cls");
	cout << "You turned to leave, but as you did, you heard a chuckling enimating from the" << endl << "darkness..." << endl;
	Sleep(3000);
	system("cls");
	cout << "It was the General!" << endl;
	Sleep(2000);
	cout << "General: 'Well done, " << iPlayersName << ", I'm impressed!" << endl;
	Sleep(3000);
	cout << "		No-one has ever managed to defeat my Joe before now, you should be proud!'" << endl;
	Sleep(3500);
	system("cls");
	cout << "General: However." << endl;
	Sleep (2500);
	system("cls");
	cout << "General: 'Joe was very valuable to me, and without him my armys will never grow." << endl;
	Sleep(3000);
	cout << "     I can always turn someone into a new Joe, but using someone weak" << endl << "will simply make the new Joe weak too.." << endl;
	Sleep(4500);
	cout << "  So who better, then, to make into my new Joe...'" << endl << " Someone strong... someone.." << endl;
	Sleep(4000);
	system("cls");
	cout << "General: 'Like you!!!'" << endl;
	Sleep(3000);
	system("cls");
	cout << "The General is attacking!!!" << endl;
	Sleep(1000);
	int GeneralBattlec;
	GeneralBattlec = GeneralBattle();
	return 0;
}

int Lewis ()
{
	//You and Lewis vs Joe
	system("cls");
		do {
	cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
	cout << "You: " << UserHP << "   " << "Lewis: " << iLewisHealth << "   " << "Joe Weller: " << EnemyHP << endl;
	char l;
	cin >> l;

	switch (l)
	{
	case 'a':
	case 'A':
		cout << "You attack!" << endl;
		Sleep(500);
		EnemyHP = EnemyHP - iDamage;
		break;
	case 'r':
	case 'R':
		if (iLifeUp < 6)
		{
		cout << "Used recover!" << endl;
		Sleep(500);
		UserHP = UserHP + 30;
		++iLifeUp;
		}
		break;
	case 'l':
	case 'L':
		cout << "!OMG SEECRIT POWUR!" << endl;
		Sleep(250);
		do {
		EnemyHP -= 20;
		cout << "!OMG SEECRIT POWUR!" << endl;
	    cout << "Joe Weller: " << EnemyHP << endl;
		system("cls");
		}while (EnemyHP > -100);
		break;
	default:
		cout << "Invalid move!" << endl;
		Sleep(500);
	}



	if (EnemyHP > 0)
	{
		int k = rand() % 16;
		if (k < 4){
	system("cls");
	cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
	cout << "You: " << UserHP << "   " << "Lewis: " << iLewisHealth << "   " << "Joe Weller: " << EnemyHP << endl;
	cout << "Joe Weller used latch!" << endl;
	Sleep(500);
	iLewisHealth -= iJoeAttack;
		} else if (k > 4 && k < 8){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Lewis: " << iLewisHealth << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe made a bad joke!" << endl;
			Sleep(500);
			iLewisHealth -= 5;
			EnemyHP += 5;
		} else if (k > 8 && k < 12){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Lewis: " << iLewisHealth << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe shuffled closer!" << endl;
			Sleep(500);
			iJoeAttack += 5;
		} else if (k > 8){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Lewis: " << iLewisHealth << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe laughed annoyingly!" << endl;
			Sleep(500);
			EnemyHP += 10;
		}

	}

	if (EnemyHP < 20 && EnemyHP > 0 && e < 2){
		cout << "Joe remembered World of Warcraft!" << endl;
		Sleep(750);
		EnemyHP = EnemyHP + 25;
		++ e;
		}

	if ((UserHP >= 2 * EnemyHP) && m < 1)
	{
		EnemyHP = EnemyHP + (UserHP / 4);
		++ m;
	}

	system("cls");
	if (EnemyHP < 1 && v != 2)
	{
		cout << "...:::!!!You WIN!!!:::..." << endl;
	    return 0;
	} else if (iLewisHealth < 1 && v != 1)
	{
		cout << "Lewis has been latched onto and recruited by the General!" << endl;
		Sleep(1000);
		EnemyHP += 10;
		return 0;
	}
	}while (apples = true);
		return 0;
}

int main () 
{
	//You vs Joe
	cin >> iPlayersName;
	int iLewis;
	do {
		//Information
	cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
	cout << "You: " << UserHP << "   " << "Joe Weller: " << EnemyHP << endl;
	//Users input
	char l;
	cin >> l;

	//Proccess the input...
	switch (l)
	{
	case 'a':
	case 'A':
		cout << "You attack!" << endl;
		Sleep(500);
		EnemyHP = EnemyHP - iDamage;
		break;
	case 'r':
	case 'R':
		if (iLifeUp < 6)
		{
		cout << "Used recover!" << endl;
		Sleep(500);
		UserHP = UserHP + 30;
		++iLifeUp;
		}
		break;
	case 's':
	case 'S':
		if (NoLewis < 1)
		{
		cout << "Use Lewis!!" << endl;
		Sleep(500);
		++NoLewis;
		iLewis = Lewis();
		}
		break;
	case 'l':
	case 'L':
		cout << "!OMG SEECRIT POWUR!" << endl;
		Sleep(250);
		do {
		EnemyHP -= 20;
		cout << "!OMG SEECRIT POWUR!" << endl;
	    cout << "Joe Weller: " << EnemyHP << endl;
		system("cls");
		}while (EnemyHP > -100);
		break;
	default:
		cout << "Invalid move!" << endl;
		Sleep(500);
	}

	//Joe's turn
	if (EnemyHP > 0)
	{
		int k = rand() % 16;
		if (k < 4){
	system("cls");
	cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
	cout << "You: " << UserHP << "   " << "Joe Weller: " << EnemyHP << endl;
	cout << "Joe Weller used latch!" << endl;
	Sleep(500);
	UserHP -= iJoeAttack;
		} else if (k > 4 && k < 8){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe made a bad joke!" << endl;
			Sleep(500);
			UserHP -= 5;
			EnemyHP += 5;
		} else if (k > 8 && k < 12){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe shuffled closer!" << endl;
			Sleep(500);
			iJoeAttack += 5;
		} else if (k > 8){
			system("cls");
			cout << "a = attack, r = recover(" << iLifeUp << "/6), s = Lewis(" << NoLewis << "/1)" << endl;
			cout << "You: " << UserHP << "   " << "Joe Weller: " << EnemyHP << endl;
			cout << "Joe laughed annoyingly!" << endl;
			Sleep(500);
			EnemyHP += 10;
		}

	}

	//Joe recovers 25 + the value of his already existing health
	//if his health is below 20 and above 0, this may only happen
	//twice.
	if (EnemyHP < 20 && EnemyHP > 0 && e < 2){
		cout << "Joe remembered World of Warcraft!" << endl;
		Sleep(750);
		EnemyHP = EnemyHP + 25;
		++ e;
		}

	if ((UserHP >= 2 * EnemyHP) && m < 1)
	{
		EnemyHP = EnemyHP + (UserHP / 4);
		++ m;
	}

	system("cls");

	//If Joe's HP is below 0 and yours isn't, move onto the Generals monologue.
	if (EnemyHP < 1 && v != 2)
	{
		cout << "...:::!!!You WIN!!!:::..." << endl;
		v = 1;
		iGeneral = General();
	    return 0;
		// If your HP is below 0 and Joe's isn't, end the game.
	} else if (UserHP < 1 && v != 1)
	{
		cout << "...Joe has latched onto you, game over..." << endl;
		v = 2;
		return 0;
	}
	}while (apples = true);
}
Just C+P it, or maybe I'll upload the file. We'll see.
Last edited by Fear; May 31, 2011 at 01:47 AM.
Yeah, that game isn't really to show anything, I posted it to encourage other people to show their actually decent stuff.
Of course, you need a compiler to run it...
Last edited by Fear; May 31, 2011 at 08:07 PM.

Guards.cpp... sorry, there's quite a bit..

ideas code:
[12:16] <@orion|work> but here is how i would set this attaking bit up
[12:17] <~Fear091> *-*
[12:17] <@orion|work> the turns in the attack will be based primarily around speed right?
[12:17] <@orion|work> well yes they will
[12:17] <@orion|work> i can see code
[12:18] <~Fear091> yeah, speed determines the attack order
[12:18] <~Fear091> well
[12:18] <~Fear091> i hope
[12:18] <~Fear091> well it does, for this
[12:18] <~Fear091> but this is just 1v1
[12:19] <@orion|work> create a framework for attaking
[12:19] <@orion|work> as in
[12:19] <@orion|work> code it so depending on a variable
[12:19] <@orion|work> such as gaurd 1
[12:19] <@orion|work> it will load up a diferent set of stats attacks etc
[12:20] <@orion|work> but battles always follow set framework
[12:20] <~Fear091> .
[12:20] <~Fear091> .
[12:20] <~Fear091> .
[12:20] <@orion|work> if speed of player > speed of baddy
[12:20] <@orion|work> turns are player, baddy, player etc.
[12:20] <@orion|work> else yayay
[12:21] <@orion|work> you got it
[12:21] <~Fear091> so
[12:21] <~Fear091> get the speeds first
[12:21] <@orion|work> exactly
[12:21] <@orion|work> also
[12:21] <@orion|work> it would make your life easier
[12:21] <@orion|work> to make it read an enenmies file
[12:22] <~Fear091> .
[12:22] <~Fear091> .
[12:22] <~Fear091> .
[12:22] <@orion|work> so that you can change there stats on the fly
[12:22] <@orion|work> as in rather than hard coding in enemy data
[12:22] <@orion|work> keep sets of files
[12:22] <@orion|work> .enemy
[12:22] <@orion|work> or something
[12:22] <@orion|work> and have the program read there data off of there
[12:23] <~Fear091> that's probably above what I can do atm
[12:23] <~Fear091> I guess I'll
[12:23] <@orion|work> nah
[12:23] <~Fear091> learn some more
[12:23] <@orion|work> thats easy
[12:23] <@orion|work> you can do it
[12:23] <~Fear091> what do you mean a file though?
[12:24] <@orion|work> as in a text file
[12:24] <~Fear091> right
[12:24] <~Fear091> enemys. what?
[12:24] <@orion|work> so like
[12:24] <@orion|work> ...
[12:24] <@orion|work> toribash
[12:24] <~Fear091> right..
[12:24] <@orion|work> reads a replay
[12:25] <@orion|work> your program will read enemy files
[12:25] <@orion|work> so like the set up of an enemie file
[12:25] <@orion|work> would include
[12:26] <@orion|work> attack,speed,health,defence
[12:26] <@orion|work> etc
[12:26] <@orion|work> or numbers that would signal the program to generate biased random stats
[12:27] <@orion|work> that way you don't have to recompile every time an enemie is too weak or too strong
[12:27] <@orion|work> it will make playtesting much easier
Free Pv2Caribou
C code:
  /* searching for patterns in the analyzed sequence - filling MkrStart[] and MkrEnd[] */
NPatterns=-1;
if (IQStr==0 || IQStr==2) {
printf ("Direct strand ...\n");
for (L=1;L<=LSeq;++L) {
if ( L%100000==0 || L==LSeq ) printf ("%li kb , %li patterns found\n",L/1000,NPatterns+1);
for (IMkr=0;IMkr<=NMkr;++IMkr) {
if (Mkr[IMkr].IQStrand!=1) {
LP=IsWord(L,Mkr[IMkr].Seq,L,Mkr[IMkr].Seq,0,&NErr,&NGoodEnds,GoodEnds,GoodEndsErr);
if (IQOverlap==0) {
if (LP>Mkr[IMkr].LastEnd) {
if (L<=Mkr[IMkr].LastEnd) {
MkrEnd[NPatterns]=LP;
}
else {
++NPatterns;
if (NPatterns>=MAXPATTERNS) {
printf ("Pattern(s) too general\n");
exit(0);
};
MkrStart[NPatterns]=L;
MkrEnd[NPatterns]=LP;
MkrType[NPatterns]=IMkr+1;
};
Mkr[IMkr].LastEnd=LP;
};
}
else {
if (LP>0) {
for (I=0;I<=NGoodEnds;++I) {
++NPatterns;
if (NPatterns>=MAXPATTERNS) {
printf ("Pattern(s) too general\n");
exit(0);
};
MkrStart[NPatterns]=L;
MkrEnd[NPatterns]=GoodEnds[I];
fprintf (OFiM,"%10i%10i %3i\n",L,GoodEnds[I],IMkr+1);
};
};
};
};
};
};
};
if (IQStr==1 || IQStr==2) {
printf ("Complementary strand ...\n");
for (IMkr=0;IMkr<=NMkr;++IMkr) {
Mkr[IMkr].LastEnd=LSeq+1;
};
for (L=LSeq;L>=1;--L) {
if ( (LSeq-L)%100000==0 || L==1 ) printf ("%li kb , %li patterns found\n",(LSeq-L)/1000,NPatterns+1);
for (IMkr=0;IMkr<=NMkr;++IMkr) {
if (Mkr[IMkr].IQStrand!=0) {
LP=IsWordC(L,Mkr[IMkr].Seq,L,Mkr[IMkr].Seq,0,&NErr,&NGoodEnds,GoodEnds,GoodEndsErr);
if (IQOverlap==0) {
if (LP<Mkr[IMkr].LastEnd && LP>0) {
if (L>=Mkr[IMkr].LastEnd) {
MkrStart[NPatterns]=LP;
}
else {
++NPatterns;
if (NPatterns>=MAXPATTERNS) {
printf ("Pattern(s) too general\n");
exit(0);
};
MkrEnd[NPatterns]=L;
MkrStart[NPatterns]=LP;
MkrType[NPatterns]=IMkr+1;
};
Mkr[IMkr].LastEnd=LP;
};
}
else {
if (LP>0) {
for (I=0;I<=NGoodEnds;++I) {
++NPatterns;
if (NPatterns>=MAXPATTERNS) {
printf ("Pattern(s) too general\n");
exit(0);
};
MkrEnd[NPatterns]=L;
MkrStart[NPatterns]=GoodEnds[I];
fprintf (OFiM,"%10i%10i %3i\n",GoodEnds[I],L,IMkr+1);
};
};
};
};
};
};
};
if (IQOverlap==0) {
for (L=0;L<=NPatterns;++L) {
fprintf (OFiM,"%10i%10i %3i\n",MkrStart[L],MkrEnd[L],MkrType[L]);
};
};
Free Pv2Caribou
\(0_o)/ I really wish I knew how this look all programmed and what not. But I don't so there. But from how nested those code tags are. I would assume it looks presentable.
A✭U|T⚜L⚜L|T❖S❖S|[Chaos]
Shablagoo!
yeah that was a loop for searching for a pattern defined in a file, converted into an interpreter.
it marks the start point and end point of any pattern thing
Free Pv2Caribou
yay
first perl script was a huge success it even does it's math

script

Free Pv2Caribou