diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-04 15:43:43 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-04 15:43:43 -0600 |
| commit | 7f13704a29228435ef6250b36f7fc277b8354c62 (patch) | |
| tree | b7edb00dcad7ac94beb12a30ebb383045ece6cbe /src/Q8/Point.java | |
| parent | 37f2196d2b140198bf0b6dd631529efd8b4cacd7 (diff) | |
get max stroke used for each player
Diffstat (limited to 'src/Q8/Point.java')
| -rw-r--r-- | src/Q8/Point.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/Q8/Point.java b/src/Q8/Point.java index 9040516..4b0b86e 100644 --- a/src/Q8/Point.java +++ b/src/Q8/Point.java @@ -1,26 +1,40 @@ package Q8; public class Point { + public static final int PLAYER1 = 0; + public static final int PLAYER2 = 1; private int player; private int score; - private static final int PLAYER1 = 0; - private static final int PLAYER2 = 1; private String stroke; - public Point(int player, String stroke, int value) { + public Point(int player, String stroke, int score) { this.player = player; this.stroke = stroke; + this.score = score; } public int getPlayer() { - return 0; + return this.player; } public int getScore() { - return 0; + return this.score; } public String getStroke() { - return ""; + switch (this.stroke) { + case "a": + return "slice"; + case "b": + return "drive"; + case "c": + return "smash"; + case "d": + return "drop"; + case "e": + return "net-shot"; + default: + return "unknown"; + } } } |
