••THIS WON'T WORK ON WINDOWS XP!!!••

This program I made for my 7th grade class won't work on the school's computers. WHY.(Windows XP)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//Made for: History homework 7th grade.
//Started on: 9/28/12
//Ended on: 9/29/12



#include <iostream>//NEEDED FOR NAMESPACE STD
#include <Windows.h>//NEEDED
#include <conio.h>//NEEDED
#include <ctime>//NEEDED
#include <cstdlib>//NEEDED
using namespace std;

int PAUSE(){
	char PAUSE;
	Sleep(300); cout << "PRESS ANY KEY TO CONTINUE!"; PAUSE=getch(); system("CLS");
	return 0;
}

int CLR(){system("cls"); return 0;}


int main(){ 
	cout << "This is a program made for my 7th grade history class.\n";
	PAUSE();
	CLR();
	cout << "You will see which Native American tribe will win if they fought.\n(It will be different every time.)\n";
	PAUSE();
	CLR();
	cout << "When using this app, press 'esc' to exit when you are asked to enter the tribe\nnumber, or enter '0'.\nThis will all make sense after you continue.\n\n";
	PAUSE();
	CLR();
	while ( 1 ){
	char T;
	cout << "Listed Native American Tribes:\n\t1.Caddos\n\t2.Karankawas\n\t3.Coahuiltecans\n\t4.Comanches\n\t5.Tonkawas\n\t6.Apaches\n\t7.Jumano\n\t8.Kiowas\nTYPE 0 TO EXIT.\n";
	cout << "Enter a Texas Native American tribe number: (This is the attacker.)\n";
	T=getch();
	if (T == VK_ESCAPE){
		exit(EXIT_SUCCESS);
	}
	if ((T != '0') && (T != '8') && (T != '1') && (T != '2') && (T != '3') && (T != '4') && (T != '5') && (T != '6') && (T != '7')) {
		system("CLS");
		cout << "\nTHAT IS NOT A CHOICE!\n";
		system("PAUSE");
		goto END;
	}
	int tribe = 0;
	int de = 0;
	system("cls");
	if (T == '1'){
		cout << "Stats:\n\t-Southeastern Culture\n\t-Permanent Villages\n\t-East Texas Timberlands\n\t-Dome-shaped homes made of mud, straw, and poles\n\t-Friends with French, sometimes fought Europeans\n\t-Had a government system, farmed, fished,\n\t engaged in warfare, and traded.\n\n";
		system("PAUSE");
		tribe = 1;
	}
	if (T == '2'){
		cout << "Stats:\n\t-Gulf Coast Culture\n\t-Nomads\n\t-Between Galveston and Corpus Cristi Bays\n\t-Easly movable homes\n\t-Killed off by settlers\n\t-Caught fish, made canoes, and made waterproof pottery\n\n";
		system("PAUSE");
		tribe = 2;
	}
	if (T == '3'){
		cout << "Stats:\n\t-Southeastern Culture\n\t-Nomads\n\t-South Plains\n\t-Easily movable homes\n\t-killed in battle before the U.S. was a country.\n\t Surviors moved to Mexico.\n\t-Used plants for medicine\n\n";
		system("PAUSE");
		tribe = 3;
	}
	if (T == '4'){
		cout << "Stats:\n\t-Plains Culture\n\t-Nomads\n\t-Parts of Mexico, Texas, Kansas, Oklahoma, Colorado, and New Mexico\n\t-Easily moveable homes\n\t-Europeans killed buffalo and removed their food supply\n\t-Controlled the land that the Apaches used to own\n\n";
		system("PAUSE");
		tribe = 4;
	}
	if (T == '5'){
		cout << "Stats:\n\t-Plains\n\t-Nomads\n\t-Present day Austin\n\t-Easily moveable homes, made of buffalo skin\n\t-Constantly at war\n\t-Lost many people because of war\n\n";
		system("PAUSE");
		tribe = 5;
	}
	if (T == '6'){
		cout << "Stats:\n\t-Plains\n\t-Nomads\n\t-Rocky Mountains far north of Texas\n\t-Easily moveable homes\n\t-Warlike and lost war with Europeans. Moved to reservations.\n\t-Abandoned hunting grounds because outnumbered\n\n";
		system("PAUSE");
		tribe = 6;
	}
	if (T == '7'){
		cout << "Stats:\n\t-Pueblo culture\n\t-Plains near Rio Grande\n\t-Permanent homes\n\t-Adobe (mud, straw, sticks)\n\t-Conflict with Apaches because of Spaniards\n\t-Traded agiculture\n\n";
		system("PAUSE");
		tribe = 7;
	}
	if (T == '8'){
		cout << "Stats:\n\t-Plains culture\n\t-Nomads\n\t-Plains of Texas\n\t-Tepees made of sticks and animal hides\n\t-Warlike\n\t-Allies with Comanches\n\t-Made glue\n\n";
		system("pAUSE");
		tribe = 8;
	}
	if (T == '0'){
		exit(EXIT_SUCCESS);
	}
	system("CLS");

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
FIX:
	CLR();
	char D = NULL;
	cout << "Listed Native American Tribes:\n\t1.Caddos\n\t2.Karankawas\n\t3.Coahuiltecans\n\t4.Comanches\n\t5.Tonkawas\n\t6.Apaches\n\t7.Jumano\n\t8.Kiowas\nTYPE 0 TO EXIT.\n";
	cout << "Enter a Texas Native American tribe number: (This is the Defender.)\n";
	D=getch();
	if (D == VK_ESCAPE){
		exit(EXIT_SUCCESS);
	}
	if ((D != '0') && (D != '8') && (D != '1') && (D != '2') && (D != '3') && (D != '4') && (D != '5') && (D != '6') && (D != '7')) {
		system("CLS");
		cout << "\nTHAT IS NOT A CHOICE!\n";
		system("PAUSE");
		goto FIX;
	}
	system("cls");
	if (D == '1'){
		cout << "Stats:\n\t-Southeastern Culture\n\t-Permanent Villages\n\t-East Texas Timberlands\n\t-Dome-shaped homes made of mud, straw, and poles\n\t-Friends with French, sometimes fought Europeans\n\t-Had a government system, farmed, fished,\n\t engaged in warfare, and traded.\n\n";
		system("PAUSE");
		de = 1;
	}
	if (D == '2'){
		cout << "Stats:\n\t-Gulf Coast Culture\n\t-Nomads\n\t-Between Galveston and Corpus Cristi Bays\n\t-Easly movable homes\n\t-Killed off by settlers\n\t-Caught fish, made canoes, and made waterproof pottery\n\n";
		system("PAUSE");
		de = 2;
	}
	if (D == '3'){
		cout << "Stats:\n\t-Southeastern Culture\n\t-Nomads\n\t-South Plains\n\t-Easily movable homes\n\t-killed in battle before the U.S. was a country.\n\t Surviors moved to Mexico.\n\t-Used plants for medicine\n\n";
		system("PAUSE");
		de = 3;
	}
	if (D == '4'){
		cout << "Stats:\n\t-Plains Culture\n\t-Nomads\n\t-Parts of Mexico, Texas, Kansas, Oklahoma, Colorado, and New Mexico\n\t-Easily moveable homes\n\t-Europeans killed buffalo and removed their food supply\n\t-Controlled the land that the Apaches used to own\n\n";
		system("PAUSE");
		de = 4;
	}
	if (D == '5'){
		cout << "Stats:\n\t-Plains\n\t-Nomads\n\t-Present day Austin\n\t-Easily moveable homes, made of buffalo skin\n\t-Constantly at war\n\t-Lost many people because of war\n\n";
		system("PAUSE");
		de = 5;
	}
	if (D == '6'){
		cout << "Stats:\n\t-Plains\n\t-Nomads\n\t-Rocky Mountains far north of Texas\n\t-Easily moveable homes\n\t-Warlike and lost war with Europeans. Moved to reservations.\n\t-Abandoned hunting grounds because outnumbered\n\n";
		system("PAUSE");
		de = 6;
	}
	if (D == '7'){
		cout << "Stats:\n\t-Pueblo culture\n\t-Plains near Rio Grande\n\t-Permanent homes\n\t-Adobe (mud, straw, sticks)\n\t-Conflict with Apaches because of Spaniards\n\t-Traded agiculture\n\n";
		system("PAUSE");
		de = 7;
	}
	if (D == '8'){
		cout << "Stats:\n\t-Plains culture\n\t-Nomads\n\t-Plains of Texas\n\t-Tepees made of sticks and animal hides\n\t-Warlike\n\t-Allies with Comanches\n\t-Made glue\n\n";
		system("pAUSE");
		de = 8;
	}
	if (D == '0'){
		exit(EXIT_SUCCESS);
	}
	system("CLS");
	char FIGHT;
	cout << "PRESS ANY KEY TO START THE FIGHT!";
	FIGHT=getch();
	int LOOP = 0;
	while (LOOP != 3){
	LOOP++;
	system("CLS");
	cout << "FIGHTING";
	Sleep(50);
	system("CLS");
	cout << "FIGHTING.";
	Sleep(50);
	system("CLS");
	cout << "FIGHTING..";
	Sleep(50);
	system("CLS");
	cout << "FIGHTING...";
	Sleep(200);
	}
	system("CLS");
	int F = NULL;
	bool W = NULL;
	if (tribe == de){cout << "You can't fight yourself!\n"; PAUSE();}

	if ((tribe == 1) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "KARANKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 3)){srand(time(0));  F = (rand()%21); if(F < 15){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 15){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 11){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 11){cout << "COMANCHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 6)){srand(time(0));  F = (rand()%30); if(F < 25){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 25){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 10){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 10){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 1) && (de == 8)){srand(time(0));  F = (rand()%30); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if ((tribe == 2) && (de == 1)){srand(time(0));  F = (rand()%20); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "KARANKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 10){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 10){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 7){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 7){cout << "COMANCHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 10){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 10){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 11){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 11){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 9){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 2) && (de == 8)){srand(time(0));  F = (rand()%20); if(F < 6){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 6){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if ((tribe == 3) && (de == 1)){srand(time(0));  F = (rand()%21); if(F < 15){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 15){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 10){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 10){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 14){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 14){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 9){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 13){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 13){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 9){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 3) && (de == 8)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 8){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if ((tribe == 4) && (de == 1)){srand(time(0));  F = (rand()%20); if(F < 11){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 11){cout << "COMANCHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 7){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 7){cout << "COMANCHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 7){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 7){cout << "COMANCHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 14){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 14){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 14){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 14){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 12){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 12){cout << "JUMANO WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 4) && (de == 8)){cout << "These two tribes are allies, they can not fight.\n"; PAUSE();}
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if ((tribe == 5) && (de == 1)){srand(time(0)); F = (rand()%20); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 9){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 14){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 14){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 10){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 10){cout << "TONKAWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 13){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 13){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 8){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 5) && (de == 8)){srand(time(0));  F = (rand()%20); if(F < 6){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 6){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if ((tribe == 6) && (de == 1)){srand(time(0));  F = (rand()%30); if(F < 25){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 25){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 13){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 13){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 14){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 14){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 13){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 13){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 11){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 11){cout << "APACHES WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "APACHES WON THE FIGHT!!!\n";} if(F >= 8){cout << "JUMANO WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 6) && (de == 8)){srand(time(0));  F = (rand()%20); if(F < 5){cout << "APACHES WON THE FIGHT!!!\n";} if(F >= 5){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	if ((tribe == 7) && (de == 1)){srand(time(0)); F = (rand()%20); if(F < 10){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 10){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 9){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 4)){srand(time(0));  F = (rand()%20); if(F < 12){cout << "COMANCHES WON THE FIGHT!!!\n";} if(F >= 12){cout << "JUMANO WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 8){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "APACHES WON THE FIGHT!!!\n";} if(F >= 8){cout << "JUMANO WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 9){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 9){cout << "JUMANOS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 7) && (de == 8)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "JUMANO WON THE FIGHT!!!\n";} if(F >= 8){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if ((tribe == 8) && (de == 1)){srand(time(0));  F = (rand()%30); if(F < 16){cout << "CADDOS WON THE FIGHT!!!\n";} if(F >= 16){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 8) && (de == 3)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "COAHUILTECANS WON THE FIGHT!!!\n";} if(F >= 8){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 8) && (de == 4)){cout << "These two tribes are allies, they can not fight.\n"; PAUSE();}

	if ((tribe == 8) && (de == 5)){srand(time(0));  F = (rand()%20); if(F < 6){cout << "TONKAWAS WON THE FIGHT!!!\n";} if(F >= 6){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 8) && (de == 6)){srand(time(0));  F = (rand()%20); if(F < 5){cout << "APACHES WON THE FIGHT!!!\n";} if(F >= 5){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 8) && (de == 7)){srand(time(0));  F = (rand()%20); if(F < 8){cout << "JUMANO WON THE FIGHT!!!\n";} if(F >= 8){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}

	if ((tribe == 8) && (de == 2)){srand(time(0));  F = (rand()%20); if(F < 6){cout << "KARANKAWAS WON THE FIGHT!!!\n";} if(F >= 6){cout << "KIOWAS WON THE FIGHT!!!\n";} PAUSE();}




	
END:
	Sleep(100);
	system("CLS");
}
}


And yes I tested it on other computers. (2 vistas and 2 windows 7s)

Thank you for your help in advance.
Last edited on
closed account (zb0S216C)
No sane person is going to dig through that code without knowing what they're looking for.

Note that ""THIS WON'T WORK ON WINDOWS XP!!!" followed by 4 large blocks of code, and no indication of where there error is, is going to get you ignored.

Locate the origin of the error, and post the code that's local to it.

Wazzak
Last edited on
There is no error it just won't run on windows xp. The code works fine but something won't let it start on windows xp. I think it is getch(), VK_EXCAPE, or goto.
I tried to assemble this code into a single file.

It won't compile.

1
2
3
4
5
6
7
    if ((T != '0') && (T != '8') && (T != '1') && (T != '2') && (T != '3') &&
        (T != '4') && (T != '5') && (T != '6') && (T != '7')) {
            system("CLS");
            cout << "\nTHAT IS NOT A CHOICE!\n";
            system("PAUSE");
            goto END;
    }


Error message:
Goto bypasses initialization of a local variable


Now I'm not going to say that "goto" should never be used, but there are almost always better alternatives.

I'm don't intend to investigate this further, sorry.

Last edited on
This works fine for me and my other computers
Why won't it work for you?
I think I found a way to take out goto do you think if I did that it will work.
Are you trying to run the executable in XP? If so, Id guess the XP machines have a different runtime version.
Maybe compiling it again on XP might solve the problem??
closed account (zb0S216C)
The fact that your code actually compiles on your machine, and not on any ones else's machine, gives me a reason to suspect that your compiler is old, and non-compliant with the standard.

What compiler are you using, and what is the version of the compiler?

Wazzak
This is weird. I took this exact code and put in in Visual Studio 2010 and it worked fine. I normally make it on Visual Studio 2012.
After fixing all the compile errors/warnings, it works for me on an xp.

You wrote a game that has the user pick two Native American tribes and then has them fight? Not appropriate at all.
What? It was for school and it is not a game.
Topic archived. No new replies allowed.