In all cases, our system beings with an empty or null database of failures. The system then plays a specified number of games of tic-tac-toe, alternatively playing moves for 'X' and 'O' until each game is complete. If a game ends in a failure, that is, if either 'X' wins or 'O' wins, or a loss by 'X' or by 'O' is unavoidable, the critical position and the losing move made in the critical position are identified and added to the failure database.
Running statistics are collected and maintained, including: the total number of games, the number of tie-games, the number of times a game ends with 'X' as the victor, the number of times a game ends with 'O' as the victor, and the number of times a possible failure was avoided by excluding a move from play that might lead to failure. After all games are played, the failure database is written to a file, and the size of the failure database is reported along with the other running statistics.