daily pastebin goal
91%
SHARE
TWEET

Untitled

a guest Jan 17th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- <![CDATA[
  2.  
  3.   ile = 6; // ile elementów losujemy
  4.  
  5.   elementy = new Array(
  6.   '1',
  7.   '2',
  8.   '3',
  9.   '4',
  10.   '5',
  11.   '6',
  12.   '7',
  13.   '8',
  14.   '9',
  15.   '10'
  16.   );
  17.  
  18.   l=new Array();
  19.   for (i=0;i<ile;i++) {
  20.   los = Math.round(Math.random()*(elementy.length-1));
  21.   jest = false;
  22.   for (j=0;j<l.length;j++) if (l[j]==los) jest=true;
  23.         if (jest) i--; else l[i] = los;
  24. }
  25.  
  26. for (i=0;i<ile;i++) document.write(elementy[l[i]]+" ");
RAW Paste Data
Top