Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package blackjack;
- import java.util.ArrayList;
- import java.util.Collections;
- /**
- *
- * @author s1900585
- */
- public class TestaaKortti {
- public static void main(String[] args) {
- ArrayList<Kortti> pakka = new ArrayList<>();
- for (int i = 1; i <= 13; i++){
- Kortti risti = new Kortti(i, "Risti");
- pakka.add(risti);
- }
- for (int j = 1; j <= 13; j++){
- Kortti ruutu = new Kortti(j, "Ruutu");
- pakka.add(ruutu);
- }
- for (int k = 1; k <= 13; k++){
- Kortti hertta = new Kortti(k, "Hertta");
- pakka.add(hertta);
- }
- for (int h = 1; h <= 13; h++){
- Kortti pata = new Kortti(h, "Pata");
- pakka.add(pata);
- }
- Collections.shuffle(pakka);
- Kortti jaettu = pakka.get(0);
- pakka.remove(jaettu);
- System.out.println(jaettu);
- System.out.println(pakka);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement