Skip to content

Instantly share code, notes, and snippets.

@christianmalek
Created October 31, 2015 20:09
Show Gist options
  • Save christianmalek/9eeb00143bf92599395c to your computer and use it in GitHub Desktop.
Save christianmalek/9eeb00143bf92599395c to your computer and use it in GitHub Desktop.
scattergories random category script
//just paste this in the debug console
function setRandomCategories(categories) {
console.clear();
categories = !categories ? 5 : categories;
var inputs = $($("table")[2]).find("input");
var max = inputs.length;
for (var i = 0; i < categories; i++) {
var randIndex = Math.floor(Math.random() * max);
$(inputs[randIndex]).prop("checked", true);
}
}
setRandomCategories();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment