#include <iostream>
#include <string>
using namespace std;
char a,b,c,d,e,f,g,h,i,j;// so these represent the empty spaces in getbrd
char x = 'X';
char o = 'O';// these are what i want to replace the empty spaces with
string name;
string name2;
char brdlog [3] [3];// im not using this yet
void getbrdstart ();//this is just the display to start with
void getbrd ();
int input;
void plyr1 ();//the function that usees a switch statment to replace spaces in \\getbrd
int main ()
{
getbrdstart ();
cout << "TIC TAC TOE BY DEVONREVENGE\n"<<endl;
cout << "player 1 enter your name..."<<endl;
cin >> name;
cout << "player 2 enter your name..."<<endl;
cin >>name2;
plyr1 ();
getbrd ();
return 0;
}
void getbrd ()
{
cout << a << "|" << b << "|" << c<<endl;
cout << "-"<< "+" << "-" << "+"<< "-"<<endl;
cout << d<<"|"<<e<<"|"<< f <<endl;
cout << "-"<< "+" << "-" << "+"<< "-"<<endl;
cout << g<<"|"<<h<<"|"<< i <<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"<< endl;
}
void getbrdstart ()
{
cout << "1" << "|" << "2" << "|" << "3"<<endl;
cout << "-"<< "+" << "-" << "+"<< "-"<<endl;
cout << "4"<<"|"<<"5"<<"|"<< "6" <<endl;
cout << "-"<< "+" << "-" << "+"<< "-"<<endl;
cout << "7"<<"|"<<"8"<<"|"<< "9\n \n" <<endl;
}
void plyr1 ()
{
cout << name << "input number to place your O"<<endl;
cin >> input;
switch (input)
{
case '1':
a=o;
break;
case '2':
b=o;
break;
case '3':
c=o;
break;
case '4':
d=o;
break;
case '5':
e=o;
break;
case '6':
f=o;
break;
case '7':
g=o;
break;
case '8':
h=o;
break;
case '9':
i=o;
break;
}
}
1 Replies - 475 Views - Last Post: 09 October 2012 - 08:20 AM
#1
do you know why my tic tac toe board wont update?
Posted 09 October 2012 - 08:17 AM
So im trying to get the program to give the chars abcdefgh and i the value of either an X or a O, only it remains blank!!
Replies To: do you know why my tic tac toe board wont update?
#2
Re: do you know why my tic tac toe board wont update?
Posted 09 October 2012 - 08:20 AM
Please don't open duplicate topics. Topic closed.
Jim
Jim
Page 1 of 1

New Topic/Question
This topic is locked



MultiQuote



|