Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. var indexes = new Set();
  2. while (indexes.size < 10) {
  3. indexes.add(randomIndex());
  4. }
  5.  
  6. function randomIndex() {
  7. i = Math.floor(Math.random() * 9);
  8. j = Math.floor(Math.random() * 11);
  9. return [i, j];
  10. }
  11.  
  12. indexes.has([i,j]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement