Lauren Green 6 年之前
父節點
當前提交
e0f20421f2
共有 2 個文件被更改,包括 12 次插入1 次删除
  1. 1
    0
      .gitignore
  2. 11
    1
      src/main/java/io/zipcoder/casino/ScoreSheet.java

+ 1
- 0
.gitignore 查看文件

@@ -9,6 +9,7 @@ local.properties
9 9
 .settings/
10 10
 .loadpath
11 11
 .recommenders
12
+.DS_Store
12 13
 
13 14
 # External tool builders
14 15
 .externalToolBuilders/

+ 11
- 1
src/main/java/io/zipcoder/casino/ScoreSheet.java 查看文件

@@ -2,6 +2,8 @@
2 2
 
3 3
 package io.zipcoder.casino;
4 4
 
5
+import com.sun.tools.javac.code.Attribute;
6
+
5 7
 import java.util.*;
6 8
 
7 9
 public class ScoreSheet {
@@ -28,6 +30,14 @@ public class ScoreSheet {
28 30
         return totalScore;
29 31
     }
30 32
 
33
+    public void printRow(Enum row, String description) {
34
+        System.out.print(String.format("%-35s",description));
35
+        if(getScore(row) != null) {
36
+            System.out.println("** " + getScore(row) + " **");
37
+        } else {
38
+            System.out.println("** open **");
39
+        }
40
+    }
31 41
 
32 42
     public void printScoreCard(){
33 43
         System.out.print(String.format("%-35s","1. Aces: Totals all Ones"));
@@ -275,6 +285,6 @@ public class ScoreSheet {
275 285
     }
276 286
 
277 287
     public Integer getScore(ROW row) {
278
-        return this.scores.get(row);
288
+        return scores.get(row);
279 289
     }
280 290
 }