Implement AI that based on tree of moves