From d217fc84e830316fee3763ebea32ea639ae01762 Mon Sep 17 00:00:00 2001 From: "s.eser" Date: Fri, 22 Mar 2024 17:37:46 +0100 Subject: [PATCH] Kartenstapel constructor fertig. --- .idea/misc.xml | 1 - .idea/vcs.xml | 6 +++ .../informatik/blackjack/Hand.java | 10 +++++ .../informatik/blackjack/Kartenstapel.java | 39 ++++++++----------- 4 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/misc.xml b/.idea/misc.xml index 07115cd..ef89d98 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/de/hs_mannheim/informatik/blackjack/Hand.java b/src/de/hs_mannheim/informatik/blackjack/Hand.java index 8b9c220..0476ad9 100644 --- a/src/de/hs_mannheim/informatik/blackjack/Hand.java +++ b/src/de/hs_mannheim/informatik/blackjack/Hand.java @@ -1,4 +1,14 @@ package de.hs_mannheim.informatik.blackjack; +import java.util.ArrayList; + public class Hand { + + ArrayList hand = new ArrayList<>(); + + Hand(Kartenstapel ks){ + + + } + } diff --git a/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java b/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java index ce0f25d..6789f3f 100644 --- a/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java +++ b/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java @@ -3,7 +3,7 @@ package de.hs_mannheim.informatik.blackjack; public class Kartenstapel { Karte[] kartenstapel = new Karte[52]; - private Kartenstapel(){ + Kartenstapel(){ int t= 2; for(int i = 0; i< 9; i++){ @@ -28,31 +28,26 @@ public class Kartenstapel { kartenstapel[i] = new Karte("Karo", "" + t); t++; } -/////////////////////////////////////////////////// + kartenstapel[36] = new Karte("Kreuz", "Bube"); + kartenstapel[37] = new Karte("Kreuz", "Dame"); + kartenstapel[38] = new Karte("Kreuz", "König"); + kartenstapel[39] = new Karte("Kreuz", "Ass"); - for(int i = 36; i< 40; i++){ - kartenstapel[i] = new Karte("Kreuz", "" + t); - t++; - } - t=1; + kartenstapel[40] = new Karte("Pik", "Bube"); + kartenstapel[41] = new Karte("Pik", "Dame"); + kartenstapel[42] = new Karte("Pik", "König"); + kartenstapel[43] = new Karte("Pik", "Ass"); - for (int i = 40; i < 44; i++) { - kartenstapel[i] = new Karte("Pik", "" + t); - t++; - } - t=1; + kartenstapel[44] = new Karte("Herz", "Bube"); + kartenstapel[45] = new Karte("Herz", "Dame"); + kartenstapel[46] = new Karte("Herz", "König"); + kartenstapel[47] = new Karte("Herz", "Ass"); - for (int i = 44; i < 48; i++) { - kartenstapel[i] = new Karte("Herz", "" + t); - t++; - } - t=1; - - for (int i = 48; i < 52; i++) { - kartenstapel[i] = new Karte("Karo", "" + t); - t++; - } + kartenstapel[48] = new Karte("Karo", "Bube"); + kartenstapel[49] = new Karte("Karo", "Dame"); + kartenstapel[50] = new Karte("Karo", "König"); + kartenstapel[51] = new Karte("Karo", "Ass"); } }