/* Hi this is Justin Catrambone from your 201 class or micheal as you call me but thats fine too. lol. Anyways i got that code working it turns out i was only missing a "Board::" in my static definition, thats all I had to do and it worked! wooo. But while I was at it I fixed some bugs in it and made it so the user would have to put in the correct information and added the ability to set your names. oh and i also made sure the user couldn't replace squares already taken by a mark with thier own mark.(i do believe thats cheating). i kind of cheated by making int main a friend of player and board but i was tired of trying to work around it and hey theres no cheating in programming right? */ #include #include using namespace std; typedef int Win[3]; class Board { private: int blanks; char Square[9]; static Win winc[8]; public: Board() { for(int n = 0; n<=8; n++) { Square[n]=n+'1'; } blanks = 9; } void Display() { cout<> mk; while(cin.fail() || mk>9 || mk<1 || board.Square[mk-1]=='o' || board.Square[mk-1]=='x') { cin.clear(); cin.ignore(); cout<<"Square does not exist or is already taken!"<>mk; } board.set(mk, p[which].get_mark()); board.Display(); if(board.win(p[which].get_mark())) { cout<< "The WINNER is, "<< p[which].name<>answer; } else if(board.draw()) { cout<< "DRAW GAME" << endl; stop = true; cout<<"Play again?"<>answer; } which = 1-which; } } }