Skip to content

Instantly share code, notes, and snippets.

@trptcolin
Created March 26, 2009 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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