Skip to content

Instantly share code, notes, and snippets.

@trptcolin
Created March 26, 2009 23:24
Show Gist options
  • Save trptcolin/86442 to your computer and use it in GitHub Desktop.
Save trptcolin/86442 to your computer and use it in GitHub Desktop.
// before:
bestScore = Math.max(bestScore, -minimax(child, depth - 1, otherPlayer);
// after:
otherPlayerScore = minimax(child, depth - 1, otherPlayer);
maxOtherPlayerScore = Math.max(otherPlayerScore, maxOtherPlayerScore);
bestScore = -maxOtherPlayerScore;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment