Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. Set<Set<Card>> possible = new HashSet<Set<Card>>();
  2. Card[] cards = your hand
  3.  
  4. for (Card card1 : cards) {
  5.     for (Card card2 : cards) {
  6.         if (card1 != card2) {
  7.             Set<Card> hand = new HashSet<Card>();
  8.             for (Card card : cards) {
  9.                 if (!card.equals(card1) || !card.equals(card2)) {
  10.                     hand.add(card);
  11.                 }
  12.             }
  13.             possible.add(temp); //this will only add it if it's different since it's a set
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement