While writing Island Commander, the temptation has always been to allow the AI to cheat, as this would make it so much easier to write.
A programmer has only two options when writing an AI if they want to make a challenging game: allow it to cheat, or to analyse the game so much that they can break down the "secret" of winning into something like a flowchart, where every situation is covered and has an appropriate response.
Needless to say, this is no easy option for anything above the simplest of games (can you imagine something like this for chess?). In addition, every time a change is made to the game, or a feature added, the whole "flowchart" (and thus the AI code) needs to be changed.
However, this is the only option, since if any situation is not covered, the human players will quickly identify it and take advantage of it, and from that point on, the AI is no competition. Something I have been told several times!