Skip to content

Instantly share code, notes, and snippets.

@lhartikk
Last active October 26, 2018 20:52
Show Gist options
  • Save lhartikk/db43b23183ede024825b333c81fdb916 to your computer and use it in GitHub Desktop.
Save lhartikk/db43b23183ede024825b333c81fdb916 to your computer and use it in GitHub Desktop.
var calculateBestMove =function(game) {
//generate all the moves for a given position
var newGameMoves = game.ugly_moves();
return newGameMoves[Math.floor(Math.random() * newGameMoves.length)];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment