After taking a course on advanced ActionScript programming, I decided to transfer my old Go Game that I had previously written in Java and turn it into a flash equivalent. I then decided to challenge myself and create a functioning AI that would challenge the human player
The original java was a simple two player take on the traditional chinese game of Go, in which the player only needs to surround an opponent once in order to win.
The transfer of the game from java to ActionScript proved to be a simple task. However implementing a challenging artificial intelligence proved to be much more challenging.I decided that the computer would function via three steps. Its first step would be to determine whether or not it could capture an opponent that turn. If it could, it would and win the game. The second step would be to protect itself. If it were to be captured in the next turn, it would make a move to prevent that from occuring. The last step if the last two were not applicable, would be to assess the player's position and make a move that would reduce the number of empty space surrounding the player's stones
This system has proved to work very well as the computer is challenging but can be beaten as well. In order to differentiate between an easy computer opponent and a more difficult one, I gave the easy one a percentage chance to make a mistake, which could allow the player to recover, or beat the computer
Skills used
ActionScript
Example
This is the full version of the game
