Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

New answers tagged


The thing I would focus on to start with is reducing code duplication. If you look at your triplechecko/x functions, it's basically the same code over and over but with different variables. I would start by replacing all the p1...9 with a container. Since it's fixed size, let's use std::array. Then lets see what we can do to reduce some of the code ...


Honestly, for the symbol, I'd just go with using uppercase characters (X and O) since the pieces don't really have any special functionality at this stage, and it's good to keep some simplicity with earlier projects. I'd put the win condition checking into the game class. If you want to reuse the board class in the future, it's a good idea for you to avoid ...

Top 50 recent answers are included