Playing cards: Difference between revisions

Content added Content deleted
m (→‎Kotlin/object-oriented: private companion)
m (→‎object-oriented: forEachIndexed)
Line 3,371: Line 3,371:


fun print() {
fun print() {
for (i in indices) {
forEachIndexed { i, s ->
print("${this[i]} ")
print("$s ")
if ((i + 1) % 13 == 0 || i == size - 1) println()
if ((i + 1) % 13 == 0 || i == size - 1) println()
}
}