Create a gist now

Instantly share code, notes, and snippets.

var results = {"Erin Ptacek": {0:0, 1:0, 2:0},
"Thomas Ptacek": {0:0, 1:0, 2:0},
"Jeremy Rauch": {0:0, 1:0, 2:0},
};
for(var i = 0; i < 1000000; i++) {
var arr = ["Erin Ptacek", "Thomas Ptacek", "Jeremy Rauch"].sort(function(x, y) { return 1 - Math.ceil(Math.random() * 100) % 3; });
for(var name in results) {
results[name][arr.indexOf(name)]++;
}
if(i % 1000 == 0) {
console.log(i);
}
}
for(var name in results) {
console.log(name);
console.log(results[name]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment