This tic tac toe machine features an unbeatable ai, meaning that you cannot beat it. Also features spam proofing for the player, win detect, full board detect, auto reset, manual reset, and options for the player to choose who starts. There is also square locking, so the player can't make a move in a square where there is already a piece.
AI functions mainly by a huge wad of AND gates. At the beginning, there are a few sets of AND gates to detect whether the machine can make any winning moves. After that, if no winning moves are found, the machine checks whether it must block any of the player's squares, so that they can't win. After that, there is a huge section full of AND gates that check for specific positions where the machine MUST make a certain move in order to prevent a definite win by the player, or to maximise the chances for a win by the machine. At the end, there is a set of smaller AND gates, basically doing the general algorithm for moving: 1. If the centre is free, take it. 2. If a corner is free, take it. 3. If an edge is free, take it. After that, there is the basic win detection system for the machine, and then the full board detection system. Unfortunately, the player has no way to win the game, so i didn't include a player win-detect system.
First choose whether you want the player to start, or the machine to start, by pressing the corresponding buttons on the top of the board. The light above the player input area shows whether it's the player's move or not. Player plays X, machine plays O. When it's your turn, press the corresponding button in the input area to place marker on the board. The machine, in about 3-10 seconds, will make its move. If the machine wins, the board will reset in around 3-5 seconds. If there is full board, the board will also reset in around 3-5 seconds. Unfortunately, the player has no way to win the game, since the machine has unbeatable AI. If the player wants to reset during the middle of a game, just press the manual reset button located at the lower left of the board.
Comments
My opinion, but im not judging it =p
Well, i would not get impressed by an AI that uses ROM, though its working :P