Home
Random
Log in
Settings
About Rosetta Code
Disclaimers
Rosetta Code
Search
Loops/Break: Difference between revisions
Page
Discussion
← Older edit
Newer edit →
Loops/Break
(view source)
Revision as of 10:34, 1 September 2023
33 bytes removed
,
8 months ago
m
→{{header|Kotlin}}
Revision as of 16:21, 4 August 2023
(
view source
)
Klint
(
talk
|
contribs
)
(
→{{header|Kotlin}}
)
← Older edit
Revision as of 10:34, 1 September 2023
(
view source
)
Klint
(
talk
|
contribs
)
m
(
→{{header|Kotlin}}
)
Newer edit →
Line 2,133:
A more compact version:
<syntaxhighlight lang="kotlin">
import
fun
kotlin.random.Random
main() {
while (
Random
(0..19)
.
nextInt
random
(
20
).also { println(it) } != 10)
▼
println(
Random
(0..19)
.
nextInt
random
(
20
))
▼
fun main() {
▲
while (Random.nextInt(20).also { println(it) } != 10)
▲
println(Random.nextInt(20))
}</syntaxhighlight>
Klint
44
edits