Skip to content

Deck

data class Deck(val cards: Set<Card>)

Multiple cards placed together.

The cards must either:

  • All have the same value.

  • All have the same color.

A deck has a value.

To store arbitrary cards, see Hand.

Constructors

Deck

constructor(cards: Set<Card>)

Types

Companion

object Companion

Properties

cards

val cards: Set<Card>

value

val value: Int

The value of a deck.

A deck [2 Red, 3 Red] has value 32:

  • The cards are sorted in descending order

  • The cards' values are concatenated together

Functions

toString

open override fun toString(): String