Tic Tac Toe in C++11
0
I wrote this,but I want to add some sort of AI, could you guys give me any pointers? (Ha, get it?).I would also be happy to hear what you have to say about the code. Also is it neat (aesthetically as well as functionally)? #include <iostream> bool end = false; int w_combinations[8][3] = {{0,1,2},{3,4,5},{6,7,8},{0,3,6},{1,4,7},{2,5,8},{0,4,8},{2,4,6}}; int pos = {1,2,3,4,5,6,7,8,9}; void check (int x) { if ( x == 10) { std::cout << "X|"; } else if (x == 11) { std::cout << "O|"; } else { std::cout << x << "|"; } } void printMatrix() { std::cout << "|" ; check(pos[0]) ; check(pos[1]) ; check(pos[2]);std::cout << "n"; std::cout << "|" ; check...