목차
[.settings]
org.eclipse.jdt.core.prefs
[bin]
poker.txt
poker_hannds.class
[src]
poker.txt
poker_hannds.java
.classpath
.project
77.1KB
파일 7, 폴더 3
org.eclipse.jdt.core.prefs
[bin]
poker.txt
poker_hannds.class
[src]
poker.txt
poker_hannds.java
.classpath
.project
77.1KB
파일 7, 폴더 3
본문내용
public static int p1Check(){
int s0 = Integer.parseInt(p1[0].substring(0,2));
int s1 = Integer.parseInt(p1[1].substring(0,2));
int s2 = Integer.parseInt(p1[2].substring(0,2));
int s3 = Integer.parseInt(p1[3].substring(0,2));
int s4 = Integer.parseInt(p1[4].substring(0,2));
char c0 = p1[0].charAt(2);
char c1 = p1[1].charAt(2);
char c2 = p1[2].charAt(2);
char c3 = p1[3].charAt(2);
char c4 = p1[4].charAt(2);
if(s0==10&&s1==11&&s2==12&&s3==13&&s4==14){//Royal Flush
if(c0==c1&&c1==c2&&c2==c3&&c3==c4){
poker1=\"Royal Flush\";
return 10;
}
}
if(c0==c1&&c1==c2&&c2==c3&&c3==c4){//Straight Flush
if((s0+s4)/2==s2&&(s4-s0)==4&&(s1-s0)==(s4-s3)){
poker1=\"Straight Flush\";
return 9;
}
}
for(int i=0; i<5; i++){//Four of a Kind
int fCout=0;
for(int j=0; j<5; j++){
if(i!=j && Integer.parseInt(p1[i].substring(0, 2)) == Integer.parseInt(p1[j].substring(0, 2))){
fCout++;
if(fCout == 3){
poker1=\"Four of a Kind\";
return 8;
}
}
}
}
int s0 = Integer.parseInt(p1[0].substring(0,2));
int s1 = Integer.parseInt(p1[1].substring(0,2));
int s2 = Integer.parseInt(p1[2].substring(0,2));
int s3 = Integer.parseInt(p1[3].substring(0,2));
int s4 = Integer.parseInt(p1[4].substring(0,2));
char c0 = p1[0].charAt(2);
char c1 = p1[1].charAt(2);
char c2 = p1[2].charAt(2);
char c3 = p1[3].charAt(2);
char c4 = p1[4].charAt(2);
if(s0==10&&s1==11&&s2==12&&s3==13&&s4==14){//Royal Flush
if(c0==c1&&c1==c2&&c2==c3&&c3==c4){
poker1=\"Royal Flush\";
return 10;
}
}
if(c0==c1&&c1==c2&&c2==c3&&c3==c4){//Straight Flush
if((s0+s4)/2==s2&&(s4-s0)==4&&(s1-s0)==(s4-s3)){
poker1=\"Straight Flush\";
return 9;
}
}
for(int i=0; i<5; i++){//Four of a Kind
int fCout=0;
for(int j=0; j<5; j++){
if(i!=j && Integer.parseInt(p1[i].substring(0, 2)) == Integer.parseInt(p1[j].substring(0, 2))){
fCout++;
if(fCout == 3){
poker1=\"Four of a Kind\";
return 8;
}
}
}
}
소개글