picoAjax - Demo 29

picoArrLen/Min/Max/Prd/Sum/Show/Sort/Shuff/Range()

<script>

   var tab = [-1, 3, 17, 9]; // tablica liczb
   
 document.write("<b>"+picoArrShow(tab)+ "</b> : tablica liczb")
 document.write( "<br>" ) 
 document.write( picoArrShow(tab,1)) + document.write(" - drugi el. tablicy");
 document.write( "<br>" ) 
 document.write(picoArrLen(tab, false)) + document.write(" - liczba el. tablicy ");
 document.write( "<br>" ) 
 document.write(picoArrMin(tab)) + document.write(" - najmniejszy el.w tablicy ");
 document.write( "<br>" ) 
 document.write(picoArrMax(tab)) + document.write(" - największy el.w tablicy ");
 document.write( "<br>" ) 
 document.write(picoArrSum(tab)) + document.write(" - suma el. tablicy ");
 document.write( "<br>" ) 
 document.write(picoArrPrd(tab)) + document.write(" - iloczyn el. tablicy");
 
</script>
<script>

   var tab = picoArrRange(1,10);
 
 document.write(picoArrShow(tab)) + document.write(": elementy tablicy ");
 document.write( "<br><br>" ) 
 
 document.write(picoArrLen(tab)) + document.write(" - liczba el. tablicy ");
 document.write( "<br>" ) 
 
 document.write(picoArrSum(tab)) + document.write(" - suma el. tablicy ");
 document.write( "<br>" ) 
 document.write(picoArrPrd(tab)) + document.write(" - iloczyn el. tablicy");
 
</script>
<script>

   var tab = [5,15,10, 1, -4];
  
 document.write(picoArrShow(tab)) + document.write(": elementy tablicy ");
 document.write( "<br><br>" ) 
 
 document.write( picoArrSort(tab)) + document.write(": elementy tab. posortowane <b>rosną…co</b>");
 document.write( "<br>" ) 
 
 
  document.write(picoArrSort(tab, false)) + document.write(": elementy tab. posortowane <b>malejąco</b>");
 document.write( "</br>" ) 
 document.write(picoArrShuff(tab)) + document.write(": elementy tab. w porzadku <b>losowowym</b>");
 
</script>
<script>
   
   // liczby Lotto 6 z 49
   
   var tab = picoArrRange(1,49);
   var m = picoArrShuff(tab);
   var l=[];
   
   for (i=0; i<6; i++) {
    l[i]=picoArrShow(m, i);
   }
   
   var s = picoArrSort(l);
   document.write('<h1>'+s+'</h1>');
   
</script>
by R.K 2016