Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package blackjack;
  7.  
  8. import java.util.ArrayList;
  9. import java.util.Collections;
  10.  
  11. /**
  12. *
  13. * @author s1900585
  14. */
  15. public class TestaaKortti {
  16. public static void main(String[] args) {
  17. ArrayList<Kortti> pakka = new ArrayList<>();
  18.  
  19. for (int i = 1; i <= 13; i++){
  20. Kortti risti = new Kortti(i, "Risti");
  21. pakka.add(risti);
  22. }
  23. for (int j = 1; j <= 13; j++){
  24. Kortti ruutu = new Kortti(j, "Ruutu");
  25. pakka.add(ruutu);
  26. }
  27. for (int k = 1; k <= 13; k++){
  28. Kortti hertta = new Kortti(k, "Hertta");
  29. pakka.add(hertta);
  30. }
  31. for (int h = 1; h <= 13; h++){
  32. Kortti pata = new Kortti(h, "Pata");
  33. pakka.add(pata);
  34. }
  35.  
  36. Collections.shuffle(pakka);
  37.  
  38. Kortti jaettu = pakka.get(0);
  39. pakka.remove(jaettu);
  40.  
  41.  
  42. System.out.println(jaettu);
  43.  
  44. System.out.println(pakka);
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement