diff --git a/tic-tac-toe b/tic-tac-toe new file mode 100644 index 0000000000..6ce6a7babb --- /dev/null +++ b/tic-tac-toe @@ -0,0 +1,81 @@ +#include +#include +using namespace std; + +int main(){ + char board[3][3] = { + {' ',' ',' '}, + {' ',' ',' '}, + {' ',' ',' '} + }; + + const char playerX = 'X'; + const char playerO = 'O'; + char currentplayer = playerX; + int r = -1; + int c = -1; + char winner = ' '; + + for(int i=0; i<9; i++){ + cout << " | | "<> r >> c; + if(r<0 || r>2 || c<0 || c>2){ + cout << "Invalid input" <