Javascript Array takeRandom()
takeRandom()
Array.prototype.takeRandom = function() { if (!this.length) { return null; } var index = Math.floor(ROT.RNG.getUniform() * this.length); return this.splice(index, 1)[0]; }