Skip to content

Instantly share code, notes, and snippets.

View xxzefgh's full-sized avatar

Mirza Brunjadze xxzefgh

  • Tbilisi, Georgia
View GitHub Profile
@xxzefgh
xxzefgh / random-non-overlapping-position.js
Created March 21, 2017 04:46 — forked from magicznyleszek/random-non-overlapping-position.js
JavaScript -- get random non-overlapping position
// declarations
var positions = [];
// Returns a random integer between min (included) and max (excluded)
// Using Math.round() will give you a non-uniform distribution!
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
// generate random positions