It was always a wonder for me that how could a game like XO work in programming and coding world, last night I was reading about Union-Find and it hit me! it might not be the best solution but this is my solution after reading about Union-Find.
note that I didnt use actual Union-Find in this code but it gave me this idea to write this code!
It is written in C++ and I belive as much as you dive in more C++ you can become a better Game Developer!
feel free to request for an update I put your ID in my code and one day we might made a really big XO game by the help of people around the Internet!