Brayzure's recent activity
-
Comment on Programming Mini-Challenge: TicTacToeBot in ~comp
-
Comment on What upcoming games or updates are you excited about? in ~games
Brayzure I'm so excited for it. It's going to be a day 1 purchase from me. If it's at all as expansive as TW3, I'll be set for a long time.I'm so excited for it. It's going to be a day 1 purchase from me. If it's at all as expansive as TW3, I'll be set for a long time.
Figured I'd post a solution in Javascript, was fun to see how I would approach it. I wanted to improve on the "check all eight lines and see if any match" solution, so I decided to modify it slightly. I reasoned that, if a winning row exists, it must pass through one of three spots. The center, or either of two opposite corners. The script checks those three spots and, if they have a mark in them, checks if a row exists that passes throw it. If a valid row exists, it's immediately returned.
The script can be run by calling
node check "O#XXXOO##"
It's not exactly short, but I'm happy with how I solved it.