Fixed minimax to account for multiple turns

I'm so proud of the nested ternary operators :)