An exercise in artificial intelligence and machine learning for a third year university subject.