Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1.  
  2. function podmiana()
  3. {
  4.  
  5. var x= document.getElementById('obrazek');
  6. var obrazki =['jeden.jpg','dwa.jpg','trzy.jpg'];
  7. var y=Math.floor(Math.random()*3);
  8. document.getElementById('obrazek').src=obrazki[y];
  9.  
  10. }
  11. setInterval(podmiana,10000);
  12. function data()
  13. {
  14. czas=new Date();
  15. document.getElementById('nicc').innerHTML=czas.getSeconds();
  16.  
  17. }
  18. setInterval(data,100);
  19. /*
  20.  
  21.  
  22.  
  23. document.write('<br>');
  24. document.write('<br>'); document.write('<br>');
  25. document.write('<br>');
  26.  
  27.  
  28. var zerojeden = [];
  29. i=0
  30.  
  31. for ( x=100; i<x; i++) {
  32. zerojeden.push(Math.round(Math.random() * 1)) // math.round zaokrągla liczby
  33. }
  34.  
  35.  
  36.  
  37.  
  38. var licz = 0
  39. for (i=1;i<x; i++)
  40. {
  41. if (zerojeden[i] ==0)
  42. licz=licz+1;
  43. }
  44. document.write('ilość zer_'+licz);
  45. document.write('<br>');
  46.  
  47.  
  48.  
  49. document.write('<br>');
  50. var jeden = 1
  51. for (i=1;i<zerojeden.length; i++)
  52. {
  53. if (zerojeden[i] ==1)
  54. jeden=jeden+1;
  55. }
  56. document.write('ilość jedynek_'+jeden);
  57. document.write('<br>');
  58.  
  59.  
  60.  
  61.  
  62. $(document.body).append('<br>')
  63. $(document.body).append(zerojeden)
  64.  
  65. $(document.body).append('<br>')
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. var arr = [];
  74. i=0
  75.  
  76. for ( x=25; i<x; i++) {
  77. arr.push(Math.round(Math.random() * 10)) // Wypełnij tablicę 25 elementową wylosowanymi liczbami całkowitymi z zakresu 0 do 10
  78. } // array.push dodaje nowe zmienne do tablicy ( w tym przypadku losowe od 0 do 10)
  79. document.write(arr);
  80.  
  81. $(document.body).append('<br>')
  82.  
  83. function funkcja()
  84. {
  85. x=document.getElementById('login').value;
  86.  
  87. polekola=(Math.PI*x)*2
  88.  
  89. document.getElementById('nicc').innerHTML=polekola;
  90.  
  91. //Wylosuj liczbę całkowitą z zakresu 2 do 12
  92. }
  93.  
  94. document.write(Math.floor(Math.random()*10+2));
  95.  
  96. document.write('<br>'):
  97.  
  98.  
  99. /*
  100. for (y=1 ; y<=10; y++){
  101. $(document.body).append('<br>');
  102. $(document.body).append(y+ '<h1>pierwszy napis h1</h1>'+'_');
  103. var x=y+y
  104. $(document.body).append(x+'<br>');}
  105.  
  106.  
  107. for (y=2 ; y<=20; y++){
  108. $(document.body).append('<br>');
  109. $(document.body).append(y+ '<h1>pierwszy napis h1</h1>'+'_');
  110. var x=y+y
  111. $(document.body).append(x+'<br>');}
  112.  
  113.  
  114.  
  115.  
  116. $('h1').hide('slow');
  117.  
  118. $(document).ready
  119. $('h1').click(function(){
  120. $(this).hide();
  121. });
  122.  
  123. */
  124.  
  125. /*
  126. $(document.body).append('nictutajniema'); //dziala tak samo jak document.write
  127. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement