The program uses a depth-first game tree search and heuristics to come to the correct answer. In less than a second, it comes to the best move thinking about 7 moves in advance.