Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean checkTwoPair(){
- if(hand.size()<4)
- return false;
- if(this.checkFullHouse()||this.checkFlush()||this.checkThreeOfKind())
- return false;
- if(!this.checkPair())
- return false;
- if(checkPair()){
- Card[] sortedArray = hand.toArray(new Card[0]);
- Arrays.sort(sortedArray);
- int count=0;
- for(int i =0;i<hand.size()-1;i++){
- if(sortedArray[i]==sortedArray[i+1])
- count++;
- }
- if(count==2)
- return true;
- }
- return false;
- }
Add Comment
Please, Sign In to add comment