Skip to main content

Timeline for TicTacToe Win Checking

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Mar 21, 2016 at 23:25 vote accept Carcigenicate
Mar 21, 2016 at 23:25 comment added Carcigenicate Thanks, I'm sure I could figure out a generator once I understand it. I just got off work, so my brains a little tired. I'll give it a look over tomorrow. Thanks again, it definitely helped.
Mar 21, 2016 at 23:01 comment added SirPython @Carcigenicate (1) I've never been told that using a flag parameter is bad, but I could very well be wrong. But honestly, a flag parameter really helps dry up your code. (2) Each number in the inner lists represent an index on the TTT board; you check all three indices for the same character. The current provided list would not work for variable length boards; you also didn't mention you were planning on having a variable-length board in you question. And yes: you could generate this list. Do you want me to update my question with a way to automatically generate the matrix?
Mar 21, 2016 at 22:52 comment added Carcigenicate Awesome, thank you. Just a question about your suggestion to change my existing functions. I was under the impression that providing a flag parameter to change the behavior of the function is poor form. Obviously though, it's likely better than my current way since it greatly reduces duplication. Is this just a limitation of my original design? And I have to admit I don't understand your matrix solution. I also wanted to allow the board to be of variable length, so a static matrix wouldn't work. Is it possible to generate the matrix?
Mar 21, 2016 at 22:44 history edited SirPython CC BY-SA 3.0
added 497 characters in body
Mar 21, 2016 at 22:33 history answered SirPython CC BY-SA 3.0