Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. color noc = color(60,60,60); //zmienna noc przyjmujaca kolor
  2. color dzien = color (255,255,255);
  3. color sciana=color(121,59,20);
  4. int godzina=0;
  5. color czerwony=color(255,0,0);
  6. color lampa=color(250,250,0);
  7. int[] tab=new int[10];
  8. color czarny=color(0,0,0);
  9. void setup()
  10. {
  11. size(600,200);
  12. frameRate(1);
  13. background(noc); // ustaw wartosc noc
  14. for(int i=0;i<10;i++)
  15. {
  16. float a=random(1);
  17. if(a<0.5)
  18. {
  19. tab[i]=80;
  20. }
  21. else
  22. {
  23. tab[i]=100;
  24. }
  25.  
  26. }
  27. }
  28. void draw()
  29. {
  30. for(int i=0;i<10;i++)
  31. {
  32. blok(5+60*i,200-tab[i],50,tab[i]);
  33. }
  34.  
  35.  
  36.  
  37. }
  38. void blok(int x, int y, int szer, int wys)
  39. {
  40. fill(sciana);
  41. rect(x,y,szer,wys);
  42.  
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement