Where to go now

You should prove yourself creating an offensive play strategy. Defensive play only tries to block the human player, without trying to beat it. It tries to draw. Try to make the computer more aggressive trying to block the human player and at the same time connecting more discs. This can be done in three steps:

  1. Watch if there are winning moves. If there is a winning column, simply play that column and don't care about the human player.
  2. If there aren't winning moves, and playing defensively you get only one column in aiMoves array, that is there's a move which will cause the most damage to a human player, play that column.
  3. If there aren't winning moves and playing defensively you get more than one column in aiMoves array, don't pick ...

Get Flash Game Development by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.