All pastes #912530 Raw Edit

Anonymous

public java v1 · immutable
·published 2008-02-21 13:09 UTC
rendered paste body
//*****************//Code by Espen Jacobssonpackage oving5.card;import java.util.Comparator;public class CardComparator implements Comparator<Card>{		public int compare(Card firstCard, Card secondCard)	{		if(firstCard.face == secondCard.face) {			if(firstCard.suit.equals(secondCard.suit)) {				return 0;			}			else if(firstCard.suitValue < secondCard.suitValue) {				return 1;			}			else {				return -1;			}		}		else if(firstCard.face > secondCard.face) {			return -1;		}		else {			return 1;		}	}}