Browse Source

BlackJackProject

De'Jon Johnson 6 years ago
parent
commit
14bfa7b28a

+ 36
- 0
src/main/java/io/zipcoder/casino/BJDealer.java View File

@@ -0,0 +1,36 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+import java.util.List;
5
+
6
+public class BJDealer extends Players {
7
+
8
+
9
+    public void shuffle(){
10
+
11
+    }
12
+
13
+    public void dealCards(){
14
+
15
+    }
16
+    public void collectCards(){
17
+
18
+    }
19
+    public void takeBets(double money){
20
+
21
+    }
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+}
36
+

+ 22
- 0
src/main/java/io/zipcoder/casino/BJPlayer.java View File

@@ -0,0 +1,22 @@
1
+package io.zipcoder.casino;
2
+
3
+public class BJPlayer extends Players {
4
+
5
+    Wallet playerwallet;
6
+    Hand playerHand;
7
+
8
+    public void hit(Deck deck){
9
+
10
+    }
11
+
12
+    public void stand(){
13
+
14
+    }
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+}

+ 35
- 0
src/main/java/io/zipcoder/casino/BlackjackGame.java View File

@@ -0,0 +1,35 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class BlackjackGame {
6
+
7
+        String BJPlayer;
8
+        String BJDealer;
9
+        Deck deck;
10
+        Double minTableBet;
11
+
12
+
13
+//        private ArrayList[] <String> player;
14
+//        private String BJPlayer;
15
+//        private String BJDealer;
16
+//        private Deck deck;
17
+//        protected Double minTableBet;
18
+
19
+
20
+        public void main (String[]args){
21
+        BlackjackGame BlackjackGame = new BlackjackGame();
22
+
23
+
24
+    }
25
+
26
+        public void session () {
27
+
28
+
29
+    }
30
+
31
+        public void startGame ( double money) {
32
+
33
+        }
34
+
35
+    }

+ 32
- 0
src/main/java/io/zipcoder/casino/Card.java View File

@@ -0,0 +1,32 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Card {
4
+    private Suit suit;
5
+    private Rank rank;
6
+
7
+
8
+    protected  int[] ranks = {1,2,3,4,5,6,7,8,9,10,11};
9
+    protected  String[] suits = {"Clubs","Diamonds","Hearts","Spades"};
10
+
11
+
12
+
13
+    public int getRank() {
14
+
15
+        return -1;
16
+    }
17
+    public void setSuit() {
18
+
19
+    }
20
+        public Integer getValue(){
21
+        return rank.getPrimaryValue();
22
+    }
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+    }
31
+
32
+

+ 5
- 0
src/main/java/io/zipcoder/casino/Casino.java View File

@@ -2,4 +2,9 @@ package io.zipcoder.casino;
2 2
 
3 3
 
4 4
 public class Casino {
5
+
6
+    public void main(String[] args) {
7
+        BlackjackGame blackJackGame = new BlackjackGame ();
8
+
9
+    }
5 10
 }

+ 32
- 0
src/main/java/io/zipcoder/casino/Deck.java View File

@@ -0,0 +1,32 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.Stack;
4
+
5
+public class Deck {
6
+    Stack<String> ListofCards = new Stack<String>();
7
+
8
+
9
+
10
+    public void shuffle(){
11
+
12
+    }
13
+
14
+    public Card pop(){
15
+        return null;
16
+
17
+    }
18
+    public void push(Card card){
19
+
20
+    }
21
+    public void peek(){
22
+
23
+    }
24
+    public boolean isEmpty(){
25
+        return false;
26
+    }
27
+
28
+
29
+
30
+
31
+}
32
+

+ 25
- 0
src/main/java/io/zipcoder/casino/Hand.java View File

@@ -0,0 +1,25 @@
1
+package io.zipcoder.casino;
2
+
3
+import java.util.ArrayList;
4
+
5
+public class Hand {
6
+    protected ArrayList<String> cardList = new ArrayList<String>();
7
+
8
+
9
+    public void add(Card card){
10
+
11
+    }
12
+    public void remove(Card card){
13
+
14
+    }
15
+    public int handSize(){
16
+        return -1;
17
+    }
18
+    public int value(){
19
+        return -1;
20
+    }
21
+
22
+
23
+
24
+
25
+}

+ 22
- 0
src/main/java/io/zipcoder/casino/Players.java View File

@@ -0,0 +1,22 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Players {
4
+
5
+    Wallet wallet;
6
+
7
+
8
+
9
+
10
+
11
+    public static void play(){
12
+
13
+    }
14
+    public static void makeBet(double money){
15
+
16
+    }
17
+
18
+
19
+
20
+
21
+
22
+}

+ 41
- 0
src/main/java/io/zipcoder/casino/Rank.java View File

@@ -0,0 +1,41 @@
1
+package io.zipcoder.casino;
2
+
3
+public enum Rank {
4
+    ACE(1,11),
5
+    TWO(2),
6
+    THREE(3),
7
+    FOUR(4),
8
+    FIVE(5),
9
+    SIX(6),
10
+    SEVEN(7),
11
+    EIGHT(8),
12
+    NINE(9),
13
+    TEN(10),
14
+    JACK(10),
15
+    QUEEN(10),
16
+    KING(10);
17
+
18
+
19
+
20
+
21
+
22
+    private final Integer primaryValue;
23
+    private final Integer secondaryValue;
24
+
25
+    Rank(Integer primaryValue){
26
+        this.primaryValue = primaryValue;
27
+        this.secondaryValue = primaryValue;
28
+    }
29
+    Rank(Integer primaryValue, Integer secondaryValue){
30
+        this.primaryValue = primaryValue;
31
+        this.secondaryValue = secondaryValue;
32
+    }
33
+
34
+    public Integer getPrimaryValue(){
35
+        return primaryValue;
36
+    }
37
+
38
+    public Integer getSecondaryValue() {
39
+        return secondaryValue;
40
+    }
41
+}

+ 19
- 0
src/main/java/io/zipcoder/casino/Suit.java View File

@@ -0,0 +1,19 @@
1
+package io.zipcoder.casino;
2
+
3
+public enum Suit {
4
+    Diamond ("♦"),
5
+    Spade ("♠"),
6
+    Heart ("♥"),
7
+    Club ("♣");
8
+    private final String symbol;
9
+
10
+
11
+    Suit(String symbol){
12
+        this.symbol =symbol;
13
+    }
14
+    public String getSymbol(){
15
+        return symbol;
16
+    }
17
+}
18
+
19
+

+ 17
- 0
src/main/java/io/zipcoder/casino/Wallet.java View File

@@ -0,0 +1,17 @@
1
+package io.zipcoder.casino;
2
+
3
+public class Wallet {
4
+    String id;
5
+    double money;
6
+
7
+
8
+
9
+    public double getMoney(){
10
+        return -1.0;
11
+    }
12
+
13
+
14
+
15
+
16
+
17
+}