Othello(); Pt. 3 The AI
This is it. The moment I have been waiting for! With the actual game part complete, all that is left is to program the AI (the reason I started this whole project). My theory on how the AI will work is pretty simple: 1) Check all valid positions 2) Pick the position with the highest outcome of flipped pieces. The first step is to eliminate all the spaces which are not possible. We know that a space is only valid if it can flip at least one piece, so that means that one of the bordering spaces of an empty piece has to contain at least one piece of the opposite color. In order to check for this, I run a 3x3 grid over every space, and if the center is empty, then it checks the surrounding spaces for one of the opposite color. If there is one of the opposite color, then it marks that space as "possible." Even though this will still mark spaces that are not technically possible, it narrows it down enough to be useful. The result is this: From here, I can the "...