Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.*;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. Lista talia = new Lista();
  10.  
  11. Random gen = new Random();
  12.  
  13. int n = gen.nextInt(14);
  14. int m;
  15.  
  16. while (n > 0) {
  17.  
  18. int i = 0;
  19. m = gen.nextInt(4);
  20.  
  21. if (talia.size() > 0)
  22. while ((n > 2) && (i < talia.size() - 1)) i++;
  23.  
  24. if (talia.size() > 0)
  25. if ((n == talia.get(i).wartosc) && (i < talia.size() - 1))
  26. if (m > talia.get(i).kolor) i++;
  27.  
  28. talia.addi(i, new Karta(m, n));
  29. n = gen.nextInt(15);
  30. }
  31.  
  32. talia.show();
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement