Guest User

Untitled

a guest
May 25th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. public boolean checkTwoPair(){
  2. if(hand.size()<4)
  3. return false;
  4. if(this.checkFullHouse()||this.checkFlush()||this.checkThreeOfKind())
  5. return false;
  6. if(!this.checkPair())
  7. return false;
  8. if(checkPair()){
  9. Card[] sortedArray = hand.toArray(new Card[0]);
  10. Arrays.sort(sortedArray);
  11. int count=0;
  12. for(int i =0;i<hand.size()-1;i++){
  13. if(sortedArray[i]==sortedArray[i+1])
  14. count++;
  15.  
  16. }
  17. if(count==2)
  18. return true;
  19. }
  20. return false;
  21. }
Add Comment
Please, Sign In to add comment