Anonymous user
Playing cards: Difference between revisions
m
→{{header|Kotlin}}: versions
m (→object-oriented: forEachIndexed) |
m (→{{header|Kotlin}}: versions) |
||
Line 3,306:
=={{header|Kotlin}}==
=== procedural style ===
{{Works with|Kotlin|1.3.50}}
<lang scala>const val FACES = "23456789TJQKA"
const val SUITS = "shdc"
Line 3,363:
=== object-oriented ===
{{Works with|Kotlin|1.4.10}}
<lang scala>class Deck : ArrayList<String> {
constructor() { FACES.forEach { face -> SUITS.forEach { add("$face$it") } } }
|