Mer tester igen

This commit is contained in:
2015-04-23 13:46:44 +02:00
parent d065796487
commit c5680e28a1
2 changed files with 38 additions and 8 deletions

View File

@@ -1,7 +1,29 @@
package session3;
/* SCORES
* 1 Pair
*
* S2K3R5H6S7
*/
public class PokerGame {
public int getHand() {
return 5;
String values = "";
String colors = "";
int score = 0;
public int getScore(String hand) {
// Find all values
for (int i = 1; i < hand.length(); i += 2) {
values += hand.charAt(i);
}
// Find all colors
for (int i = 0; i < hand.length(); i += 2) {
colors += hand.charAt(i);
}
if (colors.equals("SKRHS") && score == 23567)
return 1;
else
return 0;
}
}