Spoof game: Difference between revisions
m
→{{header|Kotlin}}: Minor layout adjustments.
(Added C) |
m (→{{header|Kotlin}}: Minor layout adjustments.) |
||
Line 199:
=={{header|Kotlin}}==
This program has a TEST mode. If you set it to true, the number of coins allocated to each player for each round won't be erased after he/she presses ENTER, which allows you to check it is working out the total for the round correctly.
<lang scala>// Version 1.2.40
import java.util.Random
Line 284:
val index2 = remaining.indexOf(n)
first = if (index2 < remaining.lastIndex) remaining[index2 + 1]
else remaining[0]
round++
}
|