This is an extension of the previous version (linked below). On this one, instead of being 2 human players, there's a player going against the computer.
The computer will play randomly in Beginner mode, but in Advanced mode, it will load scenarios, and "play" to win.
Special states have been added in order to create some "artificial intelligence", so the machine can cover certain scenarios in "Advanced mode" (although I may have missed some... leaving the player with some opportunity to win :P)
Give it a try and let me know what you think or if you find a bug.