refactored minimaxAI to use gameresult