Posts

Showing posts from March 28, 2019

Tic Tac Toe in C++11

Image
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

Non-italic (roman) subscripts in math mode

Image
5 1 Is there a way to set indices (subscripts) to non-italic globally? I'm aware of the case by case X_{text{text goes here}} But I'm having to change that across a whole document is becoming a pain. math-mode subscripts share | improve this question edited Dec 18 '18 at 20:49 Mico 273k 30 369 756 asked Dec 18 '18 at 18:09 Andy Grey 50 4