瀏覽代碼

Merge branch 'Working' into devCraps

updated
Connor Dunnigan 6 年之前
父節點
當前提交
39481c3dd8
共有 23 個文件被更改,包括 174 次插入171 次删除
  1. 30
    22
      src/main/java/io/zipcoder/casino/Casino.java
  2. 17
    15
      src/main/java/io/zipcoder/casino/cardgames/BlackJack.java
  3. 0
    24
      src/main/java/io/zipcoder/casino/cardgames/CardGame.java
  4. 15
    3
      src/main/java/io/zipcoder/casino/cardgames/GoFish.java
  5. 0
    53
      src/main/java/io/zipcoder/casino/cardgames/cards/Deck.java
  6. 9
    4
      src/main/java/io/zipcoder/casino/dicegames/Craps.java
  7. 0
    18
      src/main/java/io/zipcoder/casino/dicegames/DiceGame.java
  8. 2
    2
      src/main/java/io/zipcoder/casino/player/BlackJackPlayer.java
  9. 1
    1
      src/main/java/io/zipcoder/casino/player/CrapsPlayer.java
  10. 2
    2
      src/main/java/io/zipcoder/casino/player/GoFishPlayer.java
  11. 4
    1
      src/main/java/io/zipcoder/casino/utilities/Card.java
  12. 2
    0
      src/main/java/io/zipcoder/casino/utilities/Console.java
  13. 1
    4
      src/main/java/io/zipcoder/casino/utilities/Dice.java
  14. 0
    17
      src/main/java/io/zipcoder/casino/utilities/Game.java
  15. 22
    0
      src/main/java/io/zipcoder/casino/utilities/abstracts/CardGame.java
  16. 15
    0
      src/main/java/io/zipcoder/casino/utilities/abstracts/DiceGame.java
  17. 13
    0
      src/main/java/io/zipcoder/casino/utilities/abstracts/Game.java
  18. 2
    2
      src/main/java/io/zipcoder/casino/utilities/containers/CardHand.java
  19. 24
    0
      src/main/java/io/zipcoder/casino/utilities/containers/Deck.java
  20. 1
    1
      src/main/java/io/zipcoder/casino/utilities/enums/CardSuit.java
  21. 1
    1
      src/main/java/io/zipcoder/casino/utilities/enums/CardValue.java
  22. 1
    1
      src/main/java/io/zipcoder/casino/utilities/interfaces/Gamble.java
  23. 12
    0
      src/test/java/io/zipcoder/casino/CasinoTest.java

+ 30
- 22
src/main/java/io/zipcoder/casino/Casino.java 查看文件

@@ -7,10 +7,7 @@ import io.zipcoder.casino.dicegames.Craps;
7 7
 import io.zipcoder.casino.player.Player;
8 8
 import io.zipcoder.casino.player.Players;
9 9
 import io.zipcoder.casino.utilities.Console;
10
-import io.zipcoder.casino.utilities.Game;
11
-
12
-import java.lang.reflect.Array;
13
-import java.util.Arrays;
10
+import io.zipcoder.casino.utilities.abstracts.Game;
14 11
 
15 12
 public class Casino {
16 13
     private Game game;
@@ -31,15 +28,24 @@ public class Casino {
31 28
     }
32 29
 
33 30
     public void enterPlayers() {
34
-      int numberOfPlayers = console.getIntegerInput("WELCOME TO EPSILON CASINO, CALLED \"ALMOST A CASINO\" ON YELP\n" +
35
-              "PLEASE ENTER A NUMBER OF PLAYERS.");
36
-      String playerNames = "";
37
-      for (int i = 1; i <= numberOfPlayers; i++) {
38
-        String nameOfPlayer = console.getStringInput("PLAYER " + i + ": WHAT IS YOUR NAME?\n");
39
-        players.addPlayer(new Player(nameOfPlayer));
40
-        playerNames += nameOfPlayer + ", ";
41
-      }
42
-      console.println(playerNames + "THANK YOU FOR JOINING US");
31
+        int numberOfPlayers = getNumberOfPlayers();
32
+        String playerNames = "";
33
+        playerNames = getPlayerNames(numberOfPlayers, playerNames);
34
+        console.println(playerNames + "THANK YOU FOR JOINING US");
35
+    }
36
+
37
+    private String getPlayerNames(int numberOfPlayers, String playerNames) {
38
+        for (int i = 1; i <= numberOfPlayers; i++) {
39
+          String nameOfPlayer = console.getStringInput("PLAYER " + i + ": WHAT IS YOUR NAME?\n");
40
+          players.addPlayer(new Player(nameOfPlayer));
41
+          playerNames += nameOfPlayer + ", ";
42
+        }
43
+        return playerNames;
44
+    }
45
+
46
+    private int getNumberOfPlayers() {
47
+        return console.getIntegerInput("WELCOME TO EPSILON CASINO, CALLED \"ALMOST A CASINO\" ON YELP\n" +
48
+                  "PLEASE ENTER A NUMBER OF PLAYERS.");
43 49
     }
44 50
 
45 51
     public void chooseTable() {
@@ -52,20 +58,22 @@ public class Casino {
52 58
       Integer number=console.getIntegerInput("") ;
53 59
        switch(number){
54 60
          case 1:
55
-              console.println("WELCOME TO CRAPS\n") ;
56
-              game = new Craps();
57
-              break;
61
+             runGame(new Craps());
62
+             break;
58 63
         case 2:
59
-              console.println("WELCOME TO BLACK JACK\n") ;
60
-              game = new BlackJack();
61
-              break;
64
+             runGame(new BlackJack());
65
+             break;
62 66
         case 3:
63
-              console.println("WELCOME TO GO FISH\n");
64
-              game = new GoFish();
65
-              break;
67
+             runGame(new GoFish());
68
+             break;
66 69
        }        
67 70
      }
68 71
 
72
+    private void runGame(Game game) {
73
+        console.println("WELCOME TO %s", game.getClassName());
74
+        this.game = game;
75
+    }
76
+
69 77
     public void confirmPlayers() {
70 78
       boolean isConfirmed = false;
71 79
       while(!isConfirmed){

+ 17
- 15
src/main/java/io/zipcoder/casino/cardgames/BlackJack.java 查看文件

@@ -1,18 +1,16 @@
1 1
 package io.zipcoder.casino.cardgames;
2 2
 
3
-import io.zipcoder.casino.cardgames.cards.Card;
4
-import io.zipcoder.casino.cardgames.cards.CardHand;
5
-import io.zipcoder.casino.cardgames.cards.CardValue;
6
-import io.zipcoder.casino.cardgames.cards.Deck;
3
+import io.zipcoder.casino.utilities.Card;
4
+import io.zipcoder.casino.utilities.abstracts.CardGame;
5
+import io.zipcoder.casino.utilities.containers.CardHand;
6
+import io.zipcoder.casino.utilities.containers.Deck;
7 7
 import io.zipcoder.casino.utilities.Console;
8
-import io.zipcoder.casino.utilities.Gamble;
8
+import io.zipcoder.casino.utilities.interfaces.Gamble;
9 9
 import io.zipcoder.casino.player.BlackJackPlayer;
10 10
 import io.zipcoder.casino.player.Player;
11 11
 import io.zipcoder.casino.player.Players;
12 12
 
13
-import java.sql.SQLOutput;
14 13
 import java.util.ArrayList;
15
-import java.util.Vector;
16 14
 
17 15
 public class BlackJack extends CardGame implements Gamble {
18 16
 
@@ -25,9 +23,7 @@ public class BlackJack extends CardGame implements Gamble {
25 23
     public BlackJack(){
26 24
         readyPlayers();
27 25
         dealCards(2);
28
-        for (BlackJackPlayer p : blackJackPlayers) {
29
-          run();
30
-        }
26
+        runGame();
31 27
     }
32 28
 
33 29
     public void readyPlayers() {
@@ -36,7 +32,8 @@ public class BlackJack extends CardGame implements Gamble {
36 32
         }
37 33
     }
38 34
 
39
-    public void run(){
35
+    @Override
36
+    public void runGame(){
40 37
         for(int i = 0; i < blackJackPlayers.size(); i++){
41 38
             play(blackJackPlayers.get(i),blackJackPlayers.get(i).getBet());
42 39
         }
@@ -76,7 +73,7 @@ public class BlackJack extends CardGame implements Gamble {
76 73
 
77 74
             while (getSum(currentPlayer.getHand()) < 21) {
78 75
                 if (hitOrStand.equalsIgnoreCase("H")) {
79
-                    dealCard(currentPlayer,1);
76
+                    dealCards(currentPlayer,1);
80 77
                 } else if (hitOrStand.equalsIgnoreCase("S")) {
81 78
                     break;
82 79
                 } else {
@@ -119,7 +116,7 @@ public class BlackJack extends CardGame implements Gamble {
119 116
         }
120 117
 
121 118
 }
122
-
119
+    @Override
123 120
     public void dealCards(int numberOfCards) {
124 121
 
125 122
         for(BlackJackPlayer p: blackJackPlayers){ //deal 2 cards to each player
@@ -130,10 +127,12 @@ public class BlackJack extends CardGame implements Gamble {
130 127
         }
131 128
     }
132 129
 
133
-    public void dealCard(BlackJackPlayer p, int numberOfCards) {
130
+    @Override
131
+    public void dealCards(Player p, int numberOfCards) {
132
+        BlackJackPlayer bjp = (BlackJackPlayer) p;
134 133
         for (int i = 0; i < numberOfCards; i++) {
135 134
             Card card = deck.removeFirst();
136
-            p.getHand().add(card);
135
+            bjp.getHand().add(card);
137 136
         }
138 137
     }
139 138
 
@@ -181,5 +180,8 @@ public class BlackJack extends CardGame implements Gamble {
181 180
         dealerHand.add(newCard);
182 181
     }
183 182
 
183
+    @Override
184
+    public void promptContinue(){};
185
+
184 186
 
185 187
 }

+ 0
- 24
src/main/java/io/zipcoder/casino/cardgames/CardGame.java 查看文件

@@ -1,24 +0,0 @@
1
-package io.zipcoder.casino.cardgames;
2
-
3
-import io.zipcoder.casino.cardgames.cards.CardHand;
4
-import io.zipcoder.casino.cardgames.cards.Deck;
5
-import io.zipcoder.casino.utilities.Game;
6
-import io.zipcoder.casino.player.Player;
7
-
8
-public class CardGame extends Game {
9
-
10
-    Deck deck = new Deck();
11
-
12
-    void dealCards(Player player, int numberOfCards) {
13
-
14
-    }
15
-
16
-    public void playCard() {
17
-
18
-    }
19
-
20
-    void revealCard() {
21
-
22
-    }
23
-
24
-}

+ 15
- 3
src/main/java/io/zipcoder/casino/cardgames/GoFish.java 查看文件

@@ -1,6 +1,7 @@
1 1
 package io.zipcoder.casino.cardgames;
2 2
 
3
-import io.zipcoder.casino.cardgames.cards.Deck;
3
+import io.zipcoder.casino.utilities.abstracts.CardGame;
4
+import io.zipcoder.casino.utilities.containers.Deck;
4 5
 import io.zipcoder.casino.player.GoFishPlayer;
5 6
 import io.zipcoder.casino.player.Player;
6 7
 import io.zipcoder.casino.player.Players;
@@ -21,6 +22,11 @@ public class GoFish extends CardGame {
21 22
         runGame();
22 23
     }
23 24
 
25
+    @Override
26
+    public void runGame(){
27
+
28
+    }
29
+
24 30
     public void readyPlayers() {
25 31
         for (Player player : Players.getInstance().getPlayers()) {
26 32
             goFishPlayers.add(new GoFishPlayer(player));
@@ -38,11 +44,17 @@ public class GoFish extends CardGame {
38 44
     }
39 45
 
40 46
     @Override
41
-    void dealCards(Player player, int numberOfCards) {
42
-        super.dealCards(player, numberOfCards);
47
+    public void dealCards(Player player, int numberOfCards) {
43 48
         // dealPile = dealPile - numberOfCards;
44 49
     }
45 50
 
51
+    @Override
52
+    public void dealCards(int numberOfCards) {
53
+
54
+    }
55
+
56
+    @Override
57
+    public void promptContinue(){};
46 58
     //
47 59
     public void updateDrawPile() {
48 60
 

+ 0
- 53
src/main/java/io/zipcoder/casino/cardgames/cards/Deck.java 查看文件

@@ -1,53 +0,0 @@
1
-package io.zipcoder.casino.cardgames.cards;
2
-
3
-import io.zipcoder.casino.utilities.Console;
4
-
5
-
6
-import java.util.ArrayDeque;
7
-import java.util.ArrayList;
8
-import java.util.Collections;
9
-import java.util.Deque;
10
-
11
-public class Deck extends ArrayDeque<Card> {
12
-    // private ArrayList<Card> deck;
13
-
14
-    public Deck(){
15
-        ArrayList<Card> freshDeck = new ArrayList<>();
16
-        for (int i = 0; i < 13; i++){
17
-            CardValue value = CardValue.values()[i];
18
-
19
-            for (int j =0; j < 4;j++){
20
-                Card card = new Card (value, CardSuit.values()[j]);
21
-                freshDeck.add(card);
22
-            }
23
-        }
24
-
25
-        Collections.shuffle(freshDeck);
26
-
27
-        this.addAll(freshDeck);
28
-
29
-//        for (Card aCard : this) {
30
-//            Card oneCard = aCard;
31
-//
32
-////            Console.println(oneCard.getCardValue() + " of " + oneCard.getSuit());
33
-////            CardValue.values();
34
-//
35
-//        }
36
-    }
37
-
38
-    public static void main(String[] args) {
39
-//        CardValue[] cards = CardValue.values();
40
-//        for (CardValue value : cards) {
41
-//            System.out.println(value.getCardValue());
42
-//        }
43
-        Deck deck = new Deck();
44
-        int cardCount = 0;
45
-        for (Card card : deck) {
46
-            cardCount++;
47
-//            System.out.println(card.getCardValue() + " " + card.getSuit());
48
-        }
49
-
50
-    }
51
-
52
-
53
-}

+ 9
- 4
src/main/java/io/zipcoder/casino/dicegames/Craps.java 查看文件

@@ -1,10 +1,11 @@
1 1
 package io.zipcoder.casino.dicegames;
2 2
 
3 3
 import io.zipcoder.casino.utilities.Console;
4
-import io.zipcoder.casino.utilities.Gamble;
4
+import io.zipcoder.casino.utilities.interfaces.Gamble;
5 5
 import io.zipcoder.casino.player.CrapsPlayer;
6 6
 import io.zipcoder.casino.player.Player;
7 7
 import io.zipcoder.casino.player.Players;
8
+import io.zipcoder.casino.utilities.abstracts.DiceGame;
8 9
 
9 10
 import java.util.ArrayList;
10 11
 
@@ -15,12 +16,12 @@ public class Craps extends DiceGame implements Gamble {
15 16
 
16 17
     public Craps() {
17 18
         readyPlayers();
18
-        run();
19
+        runGame();
19 20
     }
20 21
     //for test purposes
21 22
     public Craps(ArrayList<CrapsPlayer> playerz){
22 23
         crapsPlayers.addAll(playerz);
23
-        run();
24
+        runGame();
24 25
     }
25 26
 
26 27
     public void readyPlayers() {
@@ -29,7 +30,8 @@ public class Craps extends DiceGame implements Gamble {
29 30
         }
30 31
     }
31 32
 
32
-    public void run(){
33
+    @Override
34
+    public void runGame(){
33 35
         for(int i = 0; i < crapsPlayers.size(); i++){
34 36
             greetPlayer(crapsPlayers.get(i).getP());
35 37
             play(crapsPlayers.get(i));
@@ -112,4 +114,7 @@ public class Craps extends DiceGame implements Gamble {
112 114
     public void promptEnterKey(String str){
113 115
         String input = console.getStringInput("\nPress \"ENTER\" to " + str);
114 116
     }
117
+
118
+    @Override
119
+    public void promptContinue(){};
115 120
 }

+ 0
- 18
src/main/java/io/zipcoder/casino/dicegames/DiceGame.java 查看文件

@@ -1,18 +0,0 @@
1
-package io.zipcoder.casino.dicegames;
2
-
3
-import io.zipcoder.casino.dicegames.dice.Dice;
4
-import io.zipcoder.casino.utilities.Game;
5
-
6
-public class DiceGame extends Game {
7
-
8
-    private Dice dice = new Dice(1);
9
-
10
-    public void rollDie() {
11
-    }
12
-    public int rollDie(int num) {
13
-        Dice dice = new Dice(num);
14
-        int sum = dice.tossAndSum();
15
-        return sum;
16
-    }
17
-
18
-}

+ 2
- 2
src/main/java/io/zipcoder/casino/player/BlackJackPlayer.java 查看文件

@@ -1,8 +1,8 @@
1 1
 package io.zipcoder.casino.player;
2 2
 
3
-import io.zipcoder.casino.cardgames.cards.CardHand;
3
+import io.zipcoder.casino.utilities.containers.CardHand;
4 4
 
5
-public class BlackJackPlayer{
5
+public class BlackJackPlayer extends Player{
6 6
     private CardHand hand;
7 7
     Player blackJackPlayer;
8 8
     private long bet;

+ 1
- 1
src/main/java/io/zipcoder/casino/player/CrapsPlayer.java 查看文件

@@ -1,6 +1,6 @@
1 1
 package io.zipcoder.casino.player;
2 2
 
3
-public class CrapsPlayer  {
3
+public class CrapsPlayer extends Player {
4 4
     Player crapsPlayer;
5 5
     long bet;
6 6
 

+ 2
- 2
src/main/java/io/zipcoder/casino/player/GoFishPlayer.java 查看文件

@@ -1,8 +1,8 @@
1 1
 package io.zipcoder.casino.player;
2 2
 
3
-import io.zipcoder.casino.cardgames.cards.CardHand;
3
+import io.zipcoder.casino.utilities.containers.CardHand;
4 4
 
5
-public class GoFishPlayer {
5
+public class GoFishPlayer extends Player{
6 6
     private CardHand hand;
7 7
 
8 8
     Player goFishPlayer;

src/main/java/io/zipcoder/casino/cardgames/cards/Card.java → src/main/java/io/zipcoder/casino/utilities/Card.java 查看文件

@@ -1,4 +1,7 @@
1
-package io.zipcoder.casino.cardgames.cards;
1
+package io.zipcoder.casino.utilities;
2
+
3
+import io.zipcoder.casino.utilities.enums.CardSuit;
4
+import io.zipcoder.casino.utilities.enums.CardValue;
2 5
 
3 6
 public final class Card {
4 7
 

+ 2
- 0
src/main/java/io/zipcoder/casino/utilities/Console.java 查看文件

@@ -136,6 +136,8 @@ public class Console {
136 136
         double userInput = scanner.nextDouble() ;
137 137
         return userInput;
138 138
     }
139
+
140
+
139 141
 //
140 142
 //    public Integer getPlayersInput(String prompt){
141 143
 //        Scanner scanner = new Scanner(System.in);

src/main/java/io/zipcoder/casino/dicegames/dice/Dice.java → src/main/java/io/zipcoder/casino/utilities/Dice.java 查看文件

@@ -1,8 +1,7 @@
1
-package io.zipcoder.casino.dicegames.dice;
1
+package io.zipcoder.casino.utilities;
2 2
 
3 3
     import java.util.ArrayList;
4 4
     import java.util.HashMap;
5
-    import java.util.List;
6 5
     import java.util.Random;
7 6
 
8 7
     public class Dice {
@@ -30,8 +29,6 @@ package io.zipcoder.casino.dicegames.dice;
30 29
             return lastRollGraphic;
31 30
         }
32 31
 
33
-        //        Dice(){ this.dieCount = 1; }
34
-
35 32
         public Dice(int dieCount) {
36 33
             this.dieCount = dieCount;
37 34
         }

+ 0
- 17
src/main/java/io/zipcoder/casino/utilities/Game.java 查看文件

@@ -1,17 +0,0 @@
1
-package io.zipcoder.casino.utilities;
2
-
3
-public class Game {
4
-    public void promptContinue() {
5
-        // REMATCH (runGame), NEXT GAME (return to casino), EXIT CASINO (quit)
6
-    }
7
-
8
-    public void runGame() {
9
-        //initializes game
10
-    }
11
-
12
-    public void endGame() {
13
-        //ends game, returns to Casino prompt loop
14
-    }
15
-
16
-
17
-}

+ 22
- 0
src/main/java/io/zipcoder/casino/utilities/abstracts/CardGame.java 查看文件

@@ -0,0 +1,22 @@
1
+package io.zipcoder.casino.utilities.abstracts;
2
+
3
+import io.zipcoder.casino.utilities.containers.Deck;
4
+import io.zipcoder.casino.player.Player;
5
+
6
+public abstract class CardGame extends Game {
7
+
8
+    Deck deck = new Deck();
9
+
10
+    public abstract void dealCards(Player player, int numberOfCards);
11
+
12
+    public void playCard() {
13
+
14
+    }
15
+
16
+    public abstract void dealCards(int numberOfCards);
17
+
18
+    void revealCard() {
19
+
20
+    }
21
+
22
+}

+ 15
- 0
src/main/java/io/zipcoder/casino/utilities/abstracts/DiceGame.java 查看文件

@@ -0,0 +1,15 @@
1
+package io.zipcoder.casino.utilities.abstracts;
2
+
3
+import io.zipcoder.casino.utilities.Dice;
4
+
5
+public abstract class DiceGame extends Game {
6
+
7
+    private Dice dice = new Dice(1);
8
+
9
+    public int rollDie(int num) {
10
+        Dice dice = new Dice(num);
11
+        int sum = dice.tossAndSum();
12
+        return sum;
13
+    }
14
+
15
+}

+ 13
- 0
src/main/java/io/zipcoder/casino/utilities/abstracts/Game.java 查看文件

@@ -0,0 +1,13 @@
1
+package io.zipcoder.casino.utilities.abstracts;
2
+
3
+public abstract class Game {
4
+    String className = this.getClass().getName();
5
+
6
+    public abstract void promptContinue();
7
+
8
+    public abstract void runGame();
9
+
10
+    public String getClassName() {
11
+        return className;
12
+    }
13
+}

src/main/java/io/zipcoder/casino/cardgames/cards/CardHand.java → src/main/java/io/zipcoder/casino/utilities/containers/CardHand.java 查看文件

@@ -1,6 +1,6 @@
1
-package io.zipcoder.casino.cardgames.cards;
1
+package io.zipcoder.casino.utilities.containers;
2 2
 
3
-import io.zipcoder.casino.utilities.Console;
3
+import io.zipcoder.casino.utilities.Card;
4 4
 
5 5
 import java.util.ArrayList;
6 6
 

+ 24
- 0
src/main/java/io/zipcoder/casino/utilities/containers/Deck.java 查看文件

@@ -0,0 +1,24 @@
1
+package io.zipcoder.casino.utilities.containers;
2
+
3
+import io.zipcoder.casino.utilities.Card;
4
+import io.zipcoder.casino.utilities.enums.CardSuit;
5
+import io.zipcoder.casino.utilities.enums.CardValue;
6
+
7
+import java.util.ArrayDeque;
8
+import java.util.ArrayList;
9
+import java.util.Collections;
10
+
11
+public class Deck extends ArrayDeque<Card> {
12
+    public Deck(){
13
+        ArrayList<Card> freshDeck = new ArrayList<>();
14
+        for (int i = 0; i < 13; i++){
15
+            CardValue value = CardValue.values()[i];
16
+            for (int j =0; j < 4;j++){
17
+                Card card = new Card (value, CardSuit.values()[j]);
18
+                freshDeck.add(card);
19
+            }
20
+        }
21
+        Collections.shuffle(freshDeck);
22
+        this.addAll(freshDeck);
23
+    }
24
+}

src/main/java/io/zipcoder/casino/cardgames/cards/CardSuit.java → src/main/java/io/zipcoder/casino/utilities/enums/CardSuit.java 查看文件

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino.cardgames.cards;
1
+package io.zipcoder.casino.utilities.enums;
2 2
 
3 3
 public enum CardSuit {
4 4
     HEARTS('♥'),

src/main/java/io/zipcoder/casino/cardgames/cards/CardValue.java → src/main/java/io/zipcoder/casino/utilities/enums/CardValue.java 查看文件

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino.cardgames.cards;
1
+package io.zipcoder.casino.utilities.enums;
2 2
 
3 3
 public enum CardValue {
4 4
     ACE(1),

src/main/java/io/zipcoder/casino/utilities/Gamble.java → src/main/java/io/zipcoder/casino/utilities/interfaces/Gamble.java 查看文件

@@ -1,4 +1,4 @@
1
-package io.zipcoder.casino.utilities;
1
+package io.zipcoder.casino.utilities.interfaces;
2 2
 
3 3
 import io.zipcoder.casino.player.Player;
4 4
 

+ 12
- 0
src/test/java/io/zipcoder/casino/CasinoTest.java 查看文件

@@ -1,5 +1,17 @@
1 1
 package io.zipcoder.casino;
2 2
 
3 3
 
4
+import io.zipcoder.casino.utilities.Dice;
5
+import org.junit.Test;
6
+
4 7
 public class CasinoTest {
8
+
9
+    @Test public void graphicTest() {
10
+        Dice dice = new Dice();
11
+
12
+        for (int i = 1; i <= 6; i++) {
13
+            System.out.println(dice.getDieGraphic(i));
14
+        }
15
+    }
16
+
5 17
 }