Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] hand = {2, 12, 27, 40, 39};
- String suiteNum = " ";
- int div = 0, mod = 0, val = 0, num = 0, predicator = 0;
- char suit = ' ', face = ' ';
- for (int i: hand) {
- if (i >= 1 && i <= 13) {
- suit = 'S';
- predicator = 0;
- }
- else if (i <= 26 && i>= 14) {
- suit = 'C';
- predicator = 13;
- }
- else if (i >=27 && i <= 39) {
- suit = 'D';
- predicator = 26;
- }
- else if (i<=52 && i>=40) {
- suit = 'H';
- predicator = 39;
- }
- num = i-predicator+1;
- suiteNum = Integer.toString(num);
- System.out.print(suiteNum+suit+"\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement