commit 206ae7ce765ae00904a19693e09b1a94a7f7fd6a Author: selim Date: Fri Mar 22 16:47:29 2024 +0100 Initial commit. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..07115cd --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..19f690f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PR2-BlackJackSpiel.iml b/PR2-BlackJackSpiel.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/PR2-BlackJackSpiel.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/de/hs_mannheim/informatik/blackjack/BlackJackSpiel.java b/src/de/hs_mannheim/informatik/blackjack/BlackJackSpiel.java new file mode 100644 index 0000000..59a75c1 --- /dev/null +++ b/src/de/hs_mannheim/informatik/blackjack/BlackJackSpiel.java @@ -0,0 +1,5 @@ +package de.hs_mannheim.informatik.blackjack; + +public class BlackJackSpiel { + +} diff --git a/src/de/hs_mannheim/informatik/blackjack/Hand.java b/src/de/hs_mannheim/informatik/blackjack/Hand.java new file mode 100644 index 0000000..8b9c220 --- /dev/null +++ b/src/de/hs_mannheim/informatik/blackjack/Hand.java @@ -0,0 +1,4 @@ +package de.hs_mannheim.informatik.blackjack; + +public class Hand { +} diff --git a/src/de/hs_mannheim/informatik/blackjack/Karte.java b/src/de/hs_mannheim/informatik/blackjack/Karte.java new file mode 100644 index 0000000..c5e5b1f --- /dev/null +++ b/src/de/hs_mannheim/informatik/blackjack/Karte.java @@ -0,0 +1,38 @@ +package de.hs_mannheim.informatik.blackjack; + +import java.util.Scanner; + +public class Karte { + + private String farbe; + private String karte; + + + + Karte(String farbe, String karte){ + } + + public String toString(){ + return farbe + " " + karte; + } + + public int getPunkte(){ + + if(karte.equals("Bube")||karte.equals("Dame")||karte.equals("König")) + return 10; + else if(karte.equals("Ass")) { + Scanner ass = new Scanner(System.in); + System.out.print("Soll das Ass als 1 oder 11 Punkte zählen?(1/11):"); + int entscheidung = ass.nextInt(); + if (entscheidung == 1) { + ass.close(); + return 1; + } else if (entscheidung == 11) { + ass.close(); + return 11; + } + } else + return Integer.parseInt(karte); + return 0; + } +} diff --git a/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java b/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java new file mode 100644 index 0000000..ce0f25d --- /dev/null +++ b/src/de/hs_mannheim/informatik/blackjack/Kartenstapel.java @@ -0,0 +1,58 @@ +package de.hs_mannheim.informatik.blackjack; + +public class Kartenstapel { + Karte[] kartenstapel = new Karte[52]; + + private Kartenstapel(){ + int t= 2; + + for(int i = 0; i< 9; i++){ + kartenstapel[i] = new Karte("Kreuz", "" + t); + t++; + } + t=2; + + for (int i = 9; i < 18; i++) { + kartenstapel[i] = new Karte("Pik", "" + t); + t++; + } + t=2; + + for (int i = 18; i < 27; i++) { + kartenstapel[i] = new Karte("Herz", "" + t); + t++; + } + t=2; + + for (int i = 27; i < 36; i++) { + kartenstapel[i] = new Karte("Karo", "" + t); + t++; + } +/////////////////////////////////////////////////// + + + for(int i = 36; i< 40; i++){ + kartenstapel[i] = new Karte("Kreuz", "" + t); + t++; + } + t=1; + + for (int i = 40; i < 44; i++) { + kartenstapel[i] = new Karte("Pik", "" + t); + t++; + } + t=1; + + 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++; + } + + } +} diff --git a/src/de/hs_mannheim/informatik/blackjack/Main.java b/src/de/hs_mannheim/informatik/blackjack/Main.java new file mode 100644 index 0000000..f1927db --- /dev/null +++ b/src/de/hs_mannheim/informatik/blackjack/Main.java @@ -0,0 +1,7 @@ +package de.hs_mannheim.informatik.blackjack; + +public class Main { + + + +}