I'm taking C++ for a class and as an exercise for that class I'm making a version of the game Pente. Everything is going fine except that I am drawing a blank on how to program a move in the game. The move is called capturing. If player 1 is X, player 2 is O, and + is nutural then a capture occurs player 1 moves thus: +OOX to XOOX. When this happens, the two Os in the center revert to +s and player 1 gets a point like thus:X++X. However a player cannot capture their own pieces meaning that in the situation that player 2 moves like so: XO+X to XOOX, nothing happens. This move can be done across either a diagnonul, vertically, or horizontally. I REALLY DON'T want to write out every possible occurrence that this could occur at so I need to figure out a mathematical formula or rule as a shortcut. Any ideas? Thanks
Also, if anyone notices a bug in this, PLEASE tell me.
Included is the C++ files.
PS: This is an exercise so please do not do this for me; I only need someone to point me in the right direction so that I can do this for myself.
PS: This is NOT a graded assignment.
If you have any questions, please ask

Included is the C++ files.
PS: This is an exercise so please do not do this for me; I only need someone to point me in the right direction so that I can do this for myself.
PS: This is NOT a graded assignment.
If you have any questions, please ask