Now, let's add some basic AI. Nothing too serious, just a simple, suboptimal (you could use the KMP algorithm to improve it), history matcher. It searches the user's previous moves for recurring patterns and uses this information to predict the user's next move. For anyone interested in more advanced stuff, this could be of help.