Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var indexes = new Set();
- while (indexes.size < 10) {
- indexes.add(randomIndex());
- }
- function randomIndex() {
- i = Math.floor(Math.random() * 9);
- j = Math.floor(Math.random() * 11);
- return [i, j];
- }
- indexes.has([i,j]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement