diff --git a/bin/cards/Card.class b/bin/cards/Card.class index 41dcbd5..97f026e 100644 Binary files a/bin/cards/Card.class and b/bin/cards/Card.class differ diff --git a/src/cards/Card.java b/src/cards/Card.java index 561feb4..3600c77 100644 --- a/src/cards/Card.java +++ b/src/cards/Card.java @@ -23,7 +23,15 @@ public record Card(Rank rank, Suit suit) implements Comparable { */ @Override public int compareTo(Card other) { - //TODO implement - return 0; + // First, compare ranks + int rankComparison = this.rank.compareTo(other.rank); + + if (rankComparison != 0) { + // If ranks are different, return the comparison result + return rankComparison; + } else { + // If ranks are equal, compare suits + return this.suit.compareTo(other.suit); + } } }