I have to admit that I did not put much thought into that AI, since I implemented it for a paper, but we never ended up using it. So, it's been left in the status that it was the first time around I coded it. But I think you are correct in that it might be exploitable :)
The current code just tries to do this:
- For each of the possible strategies of the Max player, the inner loop (line 170), determines which is the best answer of the opponent (Min)
- Then, the outer loop (line 167) determines which is the strategy of the Max player that would result in the maximum score (Max of the Mins).