Tic Tac ToeHelp please...
Page 1 of 1
8 Replies - 1730 Views - Last Post: 01 December 2001 - 02:14 PM
#1
Tic Tac Toe
Posted 30 November 2001 - 08:00 PM
Replies To: Tic Tac Toe
#2
Re: Tic Tac Toe
Posted 30 November 2001 - 08:05 PM
#3
Re: Tic Tac Toe
Posted 30 November 2001 - 08:44 PM
#4
Re: Tic Tac Toe
Posted 30 November 2001 - 08:56 PM
ie:
[1][1]-[1][2]-[1][3]
-------------------
[2][1]-[2][2]-[2][3]
-------------------
[3][1]-[3][2]-[3][3]
thats sorta how i did it, others would just go down the list, 1,2,3,4,5,6,7,8,9.
#5
Re: Tic Tac Toe
Posted 30 November 2001 - 09:08 PM
///////////////////////////////// //¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ //ööööööööööööööööööööööööööööööö // // Bryan Hughes // Sci Fair Project // Artifical Intellegence // Tic Tac Toe // //ööööööööööööööööööööööööööööööö //¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿ /////////////////////////////////#include<iostream.h> #include<stdlib.h> #include<time.h> #include<fstream.h> #include<time.h>
int check[9] = {0,0,0,0,0,0,0,0,0}; char pause[1]; char name[30]; char hiname[30]; char board[9] = {'1','2','3','4','5','6','7','8','9'}; int offence[50][9]; int defence[50][9]; int offcount; int defcount; int offdef; int think[9];
int gamecounter; int winlossa[3]; int winlossb[3];
int turn;
char game; int x; int r; int p1char; int p2char; int reset;
int p=0; int p1winsA; //this is p1 vs computer int highscore1;
int counter; int randnum;
ifstream infile; ofstream outfile;
void printboard(); void startgame(); void wincheck(); void exboard(); void title(); void player1(); void player2(); void comp1(); void comp2(); void game1(); void game2(); void game3(); void p1winB(); void p2win(); void p1winA(); void compwin(); void enterdata(); void gameresults(); void endgame1(); void endgame2(); void calchighscore(); void highscore(); void random();
main() { title(); return 0; }
void title() { cout << endl; cout << "************ ** ******** "; cout << " ** ** ** "; cout << " ** ** ** "; cout << " ** ** ** "; cout << " ** ** ** "; cout << " ** ** ** "; cout << " ** ** ******** "; cout << endl; cout << " ************ ******** ******** "; cout << " ** ** ** ** "; cout << " ** ******** ** "; cout << " ** ** ** ** "; cout << " ** ** ** ** "; cout << " ** ** ** ** "; cout << " ** ** ** ******** "; cout << " ************ ********* ******** "; cout << " ** ** ** ** "; cout << " ** ** ** ** "; cout << " ** ** ** **** "; cout << " ** ** ** ** "; cout << " ** ** ** ** "; cout << " ** ********* ******** ";
cout <<"Press enter to continue...... "; cin.get(pause, 1); cin.ignore(80, ' '); system("cls"); enterdata(); }
void enterdata() { system("cls"); cout << "Welcome to Super Ultra Mega Tic Tac Toe!!!!! ";
cout << "Please enter your name player... "; cin.get(name,30); cin.ignore(80,' '); cout << " Welcome "<<name<< ", I am the UGM 9000, the ultimate Tic Tac Toe Champion... "; cout << "I look forward to seeing you in the battle Arena... ";
startgame(); }
void startgame() { int gamecounterb; gamecounter++;
do { x=0; r=49; for(x=0; x<=10; x++) {check[x]=0;} for(x=0; x<=10; x++) {board[x]=r; r++;}
system("cls"); cout << "Welcome to Super Ultra Mega Tic Tac Toe!!!!! ";
cout << " "; if(gamecounter<25) {cout<< "The AI has not finished, building yet, Please play Game 1 ";} else{if(gamecounter==25) {cout<< "The AI is ready to play, please choose Game 2 "; gamecounterb++;}} if(gamecounterb==50) {cout << "That is enough, please exit the game ";} cout << "[1] 1P VS Computer (HARD CODED AI) "; cout << "[2] 1P VS Computer (LEARNING AI) "; cout << "[3] Exit Game ";
cout << "Which option would you like? "; cin >> game; cin.ignore(80, ' '); cout << " ";
switch(game) { case '1': system("cls"); game1(); break;
case '2': system("cls"); game2(); break;
case '3': system("cls"); cout << "Thanks for playing;-) "; exit(0); break;
default: cout << "Error!!!! Please enter the number code that cooresponds with the gaming option you want... "; break; } }while((game!='1')&&(game!='2')&&(game!='3'));
}
void printboard() { cout << " | | "; cout << " " << board[0] <<" | "<< " " << board[1] << " | " << board[2] <<endl; cout << " | | "; cout << "------------------ "; cout << " | | "; cout << " " << board[3] <<" | "<< " " << board[4] << " | " << board[5] <<endl; cout << " | | "; cout << "------------------ "; cout << " | | "; cout << " " << board[6] <<" | "<< " " << board[7] << " | " << board[8] <<endl; cout << " | | "; }
void wincheck() {
if((check[0]==1) && (check[1]==1) && (check[2]==1)) {endgame1();} else{ if((check[3]==1) && (check[4]==1) && (check[5]==1)) {endgame1();} else{ if((check[6]==1) && (check[7]==1) && (check[8]==1)) {endgame1();} else{ if((check[0]==1) && (check[3]==1) && (check[6]==1)) {endgame1();} else{ if((check[1]==1) && (check[4]==1) && (check[7]==1)) {endgame1();} else{ if((check[2]==1) && (check[5]==1) && (check[8]==1)) {endgame1();} else{ if((check[0]==1) && (check[4]==1) && (check[8]==1)) {endgame1();} else{ if((check[2]==1) && (check[4]==1) && (check[6]==1)) {endgame1();} else{
if((check[0]==2) && (check[1]==2) && (check[2]==2)) {endgame2();} else{ if((check[3]==2) && (check[4]==2) && (check[5]==2)) {endgame2();} else{ if((check[6]==2) && (check[7]==2) && (check[8]==2)) {endgame2();} else{ if((check[0]==2) && (check[3]==2) && (check[6]==2)) {endgame2();} else{ if((check[1]==2) && (check[4]==2) && (check[7]==2)) {endgame2();} else{ if((check[2]==2) && (check[5]==2) && (check[8]==2)) {endgame2();} else{ if((check[0]==2) && (check[4]==2) && (check[8]==2)) {endgame2();} else{ if((check[2]==2) && (check[4]==2) && (check[6]==2)) {endgame2();} else{ if((check[0]>=1)&&(check[1]>=1)&&(check[2]>=1)&&(check[3]>=1)&&(check[4]>=1)&&(check[5]>=1)&&(check[6]>=1)&&(check[7]>=1)&&(check[8]>=1)) {system("cls"); cout << "Tie Game, Nobody wins! "; if(game=='1') winlossa[2]++; if(game=='2') winlossb[2]++; cout <<"Press enter to continue...... "; cin.get(pause, 1); cin.ignore(80, ' '); system("cls"); startgame();}}}}}}}}}}}}}}}}}
}
void endgame1() { if(game=='1') winlossa[0]++; if(game=='2') winlossb[0]++;
system("cls"); printboard(); cout <<name<<" is the winner!!!!!!! "; cout << "Press enter to return to the main menu..."; cin.get(pause, 1); cin.ignore(80,' '); system("cls"); startgame(); }
void endgame2() { if(game=='1') winlossa[1]++; if(game=='2') winlossb[1]++;
system("cls"); printboard(); cout << "Looks like I win "; cout << "Press enter to return to the main menu..."; cin.get(pause, 1); cin.ignore(80,' '); cout<<endl; startgame(); }
void game1() {
cout << "Hello " << name << endl;
cout << "The rules of this game are simple.... "; cout << "Each player takes turns putting thier icons in the squares "; cout << "First player to make 3 in a row wins! "; cout << "You will be *The O's* "; cout << "I will be *The X's* ";
cout << name <<" press enter to begin!!!!! "; cin.get(pause, 1); cin.ignore(80,' '); system("cls");
p1char=1;
srand(time(0)); counter=rand()%(8); turn=0;
if(counter%2==0) {cout << "You can go first "; offcount++; offdef=0;} else{ cout << "I will go first "; offdef=1; defcount++;}
do{ if(counter%2==0) {player1();} else{ comp2(); turn++;} }while(1!=0);
}
void game2() {
cout << "Hello, "<<name<< endl; cout << endl; cout << "The rules of this game are simple.... "; cout << "Each player takes turns putting thier icons in the squares "; cout << "First player to make 3 in a row wins! "; cout << "You will be *The O's* "; cout << "I will be *The X's* ";
cout << name <<" press enter to begin!!!!! "; cin.get(pause, 1); cin.ignore(80,' '); system("cls"); p1char=1; turn = 0; srand(time(0)); counter=rand()%(8);
if(counter%2==0) {cout << "You can go first "; offcount++; offdef=0;} else{ cout << "I will go first "; defcount++; offdef=1;}
do{ if(counter%2==0) {player1();} else{ comp2(); turn++;} }while(1!=0); }
void player1() {
printboard(); cout << name<<" it is your turn.... "; do {
cout << "Enter the number square in which you would like to place ... "; cin >> x; cin.ignore(80, ' ');
if((check[x-1] ==0)||(x-1 >=8) || (x-1 <=0-1)) { board[x-1] = p1char; check[x-1] = 1; if(offdef==0) {offence[offcount-1][turn]=x-1;} else {defence[defcount-1][turn]=x-1;} wincheck(); break; break; } else {system("cls"); cout << "Wait a second that square is already occupied, or is out of range!!! Please chose another... "; } printboard();
}while((check[x-1]==1)||(check[x-1]==2)); system("cls"); counter=1; }
void random() { srand(time(0)); randnum=rand()%(8); }
void comp1() { do{
//******************* //start thinking here //******************* random(); do{ if(check[randnum]==1) {srand(time(0)); randnum=rand()%(8);} }while(check[randnum]==1);
//*************** //winning pattern //***************
if(((check[1]==2)&&(check[2]==2)&&(check[0]==0))||((check[3]==2)&&(check[4]==2)&&(check[0]==0))||((check[4]==2)&&(check[8]==2)&&(check[0]==0))) {x=0;}else{ // 1 slot if(((check[0]==2)&&(check[2]==2)&&(check[1]==0))||((check[4]==2)&&(check[7]==2)&&(check[1]==0))) {x=1;}else{ // 2 slot if(((check[1]==2)&&(check[0]==2)&&(check[2]==0))||((check[5]==2)&&(check[8]==2)&&(check[2]==0))||((check[4]==2)&&(check[6]==2)&&(check[2]==0))) {x=2;}else{ // 3 slot if(((check[0]==2)&&(check[6]==2)&&(check[3]==0))||((check[4]==2)&&(check[5]==2)&&(check[0]==0))) {x=3;}else{ // 4 slot if(((check[1]==2)&&(check[7]==2)&&(check[4]==0))||((check[3]==2)&&(check[5]==2)&&(check[4]==0))||((check[0]==2)&&(check[8]==2)&&(check[4]==0))||((check[2]==2)&&(check[6]==2)&&(check[4]==0))) {x=4;}else{ // 5 slot if(((check[2]==2)&&(check[8]==2)&&(check[5]==0))||((check[3]==2)&&(check[4]==2)&&(check[5]==0))) {x=5;}else{ // 6 slot if(((check[0]==2)&&(check[3]==2)&&(check[6]==0))||((check[7]==2)&&(check[8]==2)&&(check[6]==0))||((check[4]==2)&&(check[2]==2)&&(check[6]==0))) {x=6;}else{ // 7 slot if(((check[1]==2)&&(check[4]==2)&&(check[7]==0))||((check[6]==2)&&(check[8]==2)&&(check[7]==0))) {x=7;}else{ // 8 slot if(((check[2]==2)&&(check[5]==2)&&(check[8]==0))||((check[6]==2)&&(check[7]==2)&&(check[8]==0))||((check[0]==2)&&(check[4]==2)&&(check[8]==0))) {x=8;}else{
//**************** //blocking pattern //**************** // 0 slot if(((check[1]==1)&&(check[2]==1)&&(check[0]==0))||((check[3]==1)&&(check[4]==1)&&(check[0]==0))||((check[4]==1)&&(check[8]==1)&&(check[0]==0))) {x=0;}else{ // 1 slot if(((check[0]==1)&&(check[2]==1)&&(check[1]==0))||((check[4]==1)&&(check[7]==1)&&(check[1]==0))) {x=1;}else{ // 2 slot if(((check[1]==1)&&(check[0]==1)&&(check[2]==0))||((check[5]==1)&&(check[8]==1)&&(check[2]==0))||((check[4]==1)&&(check[6]==1)&&(check[2]==0))) {x=2;}else{ // 3 slot if(((check[0]==1)&&(check[6]==1)&&(check[3]==0))||((check[4]==1)&&(check[5]==1)&&(check[0]==0))||((check[4]==1)&&(check[5]==1)&&(check[3]==0))) {x=3;}else{ // 4 slot if(((check[1]==1)&&(check[7]==1)&&(check[4]==0))||((check[3]==1)&&(check[5]==1)&&(check[4]==0))||((check[0]==1)&&(check[8]==1)&&(check[4]==0))||((check[2]==1)&&(check[6]==1)&&(check[4]==0))) {x=4;}else{ // 5 slot if(((check[2]==1)&&(check[8]==1)&&(check[5]==0))||((check[3]==1)&&(check[4]==1)&&(check[5]==0))||((check[3]==1)&&(check[4]==1)&&(check[5]==0))) {x=5;}else{ // 6 slot if(((check[0]==1)&&(check[3]==1)&&(check[6]==0))||((check[7]==1)&&(check[8]==1)&&(check[6]==0))||((check[4]==1)&&(check[2]==1)&&(check[6]==0))) {x=6;}else{ // 7 slot if(((check[1]==1)&&(check[4]==1)&&(check[7]==0))||((check[6]==1)&&(check[8]==1)&&(check[7]==0))) {x=7;}else{ // 8 slot if(((check[2]==1)&&(check[5]==1)&&(check[8]==0))||((check[6]==1)&&(check[7]==1)&&(check[8]==0))||((check[0]==1)&&(check[4]==1)&&(check[8]==0))) {x=8;}
else{
//************ //base pattern 0-8 //************
//attack pattern 0
if(randnum==0) {if(check[0]==0) {x=0;}else{ if(check[4]==0) {x=4;}else{ if(check[8]==0) {x=8;}else{ if(check[3]==0) {x=3;}else{ if(check[6]==0) {x=6;}else{ if(check[1]==0) {x=1;}else{ if(check[2]==0) {x=2;}else{ if(check[5]==0) {x=5;}else{ if(check[7]==0) {x=7;}} }}}}}}}}
else{
//attack pattern 1
if(randnum==1) {if(check[1]==0) {x=1;}else{ if(check[3]==0) {x=3;}else{ if(check[0]==0) {x=0;}else{ if(check[2]==0) {x=2;}else{ if(check[6]==0) {x=6;}else{ if(check[4]==0) {x=4;}else{ if(check[8]==0) {x=8;}else{ if(check[5]==0) {x=5;}else{ if(check[7]==0) {x=7;}} }}}}}}}}
else{
//attack pattern 2
if(randnum==2) {if(check[2]==0) {x=2;}else{ if(check[4]==0) {x=4;}else{ if(check[6]==0) {x=6;}else{ if(check[1]==0) {x=1;}else{ if(check[0]==0) {x=0;}else{ if(check[5]==0) {x=5;}else{ if(check[8]==0) {x=8;}else{ if(check[3]==0) {x=3;}else{ if(check[7]==0) {x=7;}} }}}}}}}} else{
//attack pattern 3
if(randnum==3) {if(check[3]==0) {x=3;}else{ if(check[7]==0) {x=7;}else{ if(check[6]==0) {x=6;}else{ if(check[0]==0) {x=0;}else{ if(check[8]==0) {x=8;}else{ if(check[4]==0) {x=4;}else{ if(check[2]==0) {x=2;}else{ if(check[1]==0) {x=1;}else{ if(check[5]==0) {x=5;}} }}}}}}}} else{
//attack pattern 4
if(randnum==4) {if(check[4]==0) {x=4;}else{ if(check[8]==0) {x=8;}else{ if(check[0]==0) {x=0;}else{ if(check[3]==0) {x=3;}else{ if(check[5]==0) {x=5;}else{ if(check[1]==0) {x=1;}else{ if(check[2]==0) {x=2;}else{ if(check[6]==0) {x=6;}else{ if(check[7]==0) {x=7;}} }}}}}}}} else{
//attack pattern 5
if(randnum==5) {if(check[5]==0) {x=5;}else{ if(check[7]==0) {x=7;}else{ if(check[2]==0) {x=2;}else{ if(check[8]==0) {x=8;}else{ if(check[0]==0) {x=0;}else{ if(check[1]==0) {x=1;}else{ if(check[4]==0) {x=4;}else{ if(check[6]==0) {x=6;}else{ if(check[3]==0) {x=3;}} }}}}}}}} else{
//attack pattern 6
if(randnum==6) {if(check[6]==0) {x=6;}else{ if(check[5]==0) {x=5;}else{ if(check[4]==0) {x=4;}else{ if(check[2]==0) {x=2;}else{ if(check[8]==0) {x=8;}else{ if(check[0]==0) {x=0;}else{ if(check[3]==0) {x=3;}else{ if(check[1]==0) {x=1;}else{ if(check[7]==0) {x=7;}} }}}}}}}} else{
//attack pattern 7
if(randnum==7) {if(check[7]==0) {x=7;}else{ if(check[0]==0) {x=0;}else{ if(check[6]==0) {x=6;}else{ if(check[3]==0) {x=3;}else{ if(check[8]==0) {x=8;}else{ if(check[4]==0) {x=4;}else{ if(check[2]==0) {x=2;}else{ if(check[1]==0) {x=1;}else{ if(check[5]==0) {x=5;}} }}}}}}}} else{
//attack pattern 8
if(randnum==8) {if(check[8]==0) {x=8;}else{ if(check[2]==0) {x=2;}else{ if(check[0]==0) {x=0;}else{ if(check[6]==0) {x=6;}else{ if(check[4]==0) {x=4;}else{ if(check[1]==0) {x=1;}else{ if(check[5]==0) {x=5;}else{ if(check[3]==0) {x=3;}else{ if(check[7]==0) {x=7;}} }}}}}}}}
}}}}}}}}}}}}}}}}}}}}}}}}}}
//************* // end thinking //*************
if((check[x]==0)||(x>=8) || (x<=0-1)) { board[x] = 88; check[x] = 2;
wincheck(); printboard(); cout <<"Press enter to continue "; cin.get(pause,1); cin.ignore(80, ' '); break; break; } else {cout << "Wait a second that square is already occupied, or is out of range!!! Please chose another... "; cout <<"Press enter to continue "; cin.get(pause,1); cin.ignore(80, ' '); }
}while((check[x-1]==1)||(check[x-1]==2)); system("cls"); randnum=2; }
void comp2() {
random(); do{
cout << "Enter the number square in which you would like to place ... ";
//******************* //start thinking here //*******************
//*************** //winning pattern //***************
if(((check[1]==2)&&(check[2]==2)&&(check[0]==0))||((check[3]==2)&&(check[4]==2)&&(check[0]==0))||((check[4]==2)&&(check[8]==2)&&(check[0]==0))) {x=0;}else{ // 1 slot if(((check[0]==2)&&(check[2]==2)&&(check[1]==0))||((check[4]==2)&&(check[7]==2)&&(check[1]==0))) {x=1;}else{ // 2 slot if(((check[1]==2)&&(check[0]==2)&&(check[2]==0))||((check[5]==2)&&(check[8]==2)&&(check[2]==0))||((check[4]==2)&&(check[6]==2)&&(check[2]==0))) {x=2;}else{ // 3 slot if(((check[0]==2)&&(check[6]==2)&&(check[3]==0))||((check[4]==2)&&(check[5]==2)&&(check[0]==0))) {x=3;}else{ // 4 slot if(((check[1]==2)&&(check[7]==2)&&(check[4]==0))||((check[3]==2)&&(check[5]==2)&&(check[4]==0))||((check[0]==2)&&(check[8]==2)&&(check[4]==0))||((check[2]==2)&&(check[6]==2)&&(check[4]==0))) {x=4;}else{ // 5 slot if(((check[2]==2)&&(check[8]==2)&&(check[5]==0))||((check[3]==2)&&(check[4]==2)&&(check[5]==0))) {x=5;}else{ // 6 slot if(((check[0]==2)&&(check[3]==2)&&(check[6]==0))||((check[7]==2)&&(check[8]==2)&&(check[6]==0))||((check[4]==2)&&(check[2]==2)&&(check[6]==0))) {x=6;}else{ // 7 slot if(((check[1]==2)&&(check[4]==2)&&(check[7]==0))||((check[6]==2)&&(check[8]==2)&&(check[7]==0))) {x=7;}else{ // 8 slot if(((check[2]==2)&&(check[5]==2)&&(check[8]==0))||((check[6]==2)&&(check[7]==2)&&(check[8]==0))||((check[0]==2)&&(check[4]==2)&&(check[8]==0))) {x=8;}else{
//**************** //blocking pattern //**************** // 0 slot if(((check[1]==1)&&(check[2]==1)&&(check[0]==0))||((check[3]==1)&&(check[4]==1)&&(check[0]==0))||((check[4]==1)&&(check[8]==1)&&(check[0]==0))) {x=0;}else{ // 1 slot if(((check[0]==1)&&(check[2]==1)&&(check[1]==0))||((check[4]==1)&&(check[7]==1)&&(check[1]==0))) {x=1;}else{ // 2 slot if(((check[1]==1)&&(check[0]==1)&&(check[2]==0))||((check[5]==1)&&(check[8]==1)&&(check[2]==0))||((check[4]==1)&&(check[6]==1)&&(check[2]==0))) {x=2;}else{ // 3 slot if(((check[0]==1)&&(check[6]==1)&&(check[3]==0))||((check[4]==1)&&(check[5]==1)&&(check[0]==0))||((check[4]==1)&&(check[5]==1)&&(check[3]==0))) {x=3;}else{ // 4 slot if(((check[1]==1)&&(check[7]==1)&&(check[4]==0))||((check[3]==1)&&(check[5]==1)&&(check[4]==0))||((check[0]==1)&&(check[8]==1)&&(check[4]==0))||((check[2]==1)&&(check[6]==1)&&(check[4]==0))) {x=4;}else{ // 5 slot if(((check[2]==1)&&(check[8]==1)&&(check[5]==0))||((check[3]==1)&&(check[4]==1)&&(check[5]==0))||((check[3]==1)&&(check[4]==1)&&(check[5]==0))) {x=5;}else{ // 6 slot if(((check[0]==1)&&(check[3]==1)&&(check[6]==0))||((check[7]==1)&&(check[8]==1)&&(check[6]==0))||((check[4]==1)&&(check[2]==1)&&(check[6]==0))) {x=6;}else{ // 7 slot if(((check[1]==1)&&(check[4]==1)&&(check[7]==0))||((check[6]==1)&&(check[8]==1)&&(check[7]==0))) {x=7;}else{ // 8 slot if(((check[2]==1)&&(check[5]==1)&&(check[8]==0))||((check[6]==1)&&(check[7]==1)&&(check[8]==0))||((check[0]==1)&&(check[4]==1)&&(check[8]==0))) {x=8;}
else{ //******************* //base pattern 0-8 //*******************
srand(time(0)); randnum=rand()%(8); x=randnum;
}}}}}}}}}}}}}}}}}}
//************* // end thinking //*************
if((check[x]==0)||(x>=8) || (x<=0-1)) { board[x] = 88; check[x] = 2;
if(offdef==0) {offence[offcount-1][turn]=x-1;} else {defence[defcount-1][turn]=x-1;}
wincheck(); printboard(); cout <<"Press enter to continue "; cin.get(pause,1); cin.ignore(80, ' '); break; break; } else{} }while((check[x-1]==1)||(check[x-1]==2)); system("cls"); counter=2; }
/* void highscore() { system("cls"); infile.open("highscore.dat", ios::in); infile >> highscore1; infile.ignore(80, ' '); infile.close(); infile.open("name.dat", ios::in); infile.get(hiname, 30); infile.ignore(80, ' '); infile.close();
cout <<"*************************************************************************** "; cout <<"*************************************************************************** "; cout <<"Highscore held by: "<<hiname<< ", with "<<highscore1<< " consecutive wins! "; cout <<"*************************************************************************** "; cout <<"*************************************************************************** ";
cout << "Press enter to return to the main menu..."; cin.get(pause, 1); cin.ignore(80, ' '); startgame(); }
*/
#6
Re: Tic Tac Toe
Posted 30 November 2001 - 10:02 PM
P.S. Nova Dragoon - obviously my program will look nothing like your masterpiece when I'm done. I will use it as a reference, however. It's always easier to see how someone did it correctly. Thanks so much.
#7
Re: Tic Tac Toe
Posted 01 December 2001 - 10:57 AM
#8
Re: Tic Tac Toe
Posted 01 December 2001 - 11:03 AM
i do think we should get a challenge up sometime though, just you know, lets try for after finals, ;)
#9
Re: Tic Tac Toe
Posted 01 December 2001 - 02:14 PM
way too many if else statements.
Your AI was Much better than mine though i give you that.
Oh and by the way don't ever post all of your code like that again. It makes us look bad. I won't change it because it is way too late for that now. But pleeeease don't do that.
|
|

New Topic/Question
Reply




MultiQuote





|