Kartenstapel constructor fertig.

master
s.eser 2024-03-22 17:37:46 +01:00
parent 206ae7ce76
commit d217fc84e8
4 changed files with 33 additions and 23 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />

6
.idea/vcs.xml 100644
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,4 +1,14 @@
package de.hs_mannheim.informatik.blackjack;
import java.util.ArrayList;
public class Hand {
ArrayList<Karte> hand = new ArrayList<>();
Hand(Kartenstapel ks){
}
}

View File

@ -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");
}
}