Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Set<Set<Card>> possible = new HashSet<Set<Card>>();
- Card[] cards = your hand
- for (Card card1 : cards) {
- for (Card card2 : cards) {
- if (card1 != card2) {
- Set<Card> hand = new HashSet<Card>();
- for (Card card : cards) {
- if (!card.equals(card1) || !card.equals(card2)) {
- hand.add(card);
- }
- }
- possible.add(temp); //this will only add it if it's different since it's a set
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement