From 14f44deca27d0d764b554973af442bcd960fbf39 Mon Sep 17 00:00:00 2001 From: Sarah Haggarty Date: Mon, 24 Jul 2023 11:59:34 +0100 Subject: [PATCH] update: add println to some tour examples --- docs/topics/time-measurement.md | 3 --- docs/topics/tour/kotlin-tour-collections.md | 14 ++++++++++++-- docs/topics/tour/kotlin-tour-hello-world.md | 2 ++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/topics/time-measurement.md b/docs/topics/time-measurement.md index 1f4a5fe2d6c..fe550829615 100644 --- a/docs/topics/time-measurement.md +++ b/docs/topics/time-measurement.md @@ -301,13 +301,10 @@ to create a [`TimeMark`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.tim import kotlin.time.* fun main() { -//sampleStart val timeSource = TimeSource.Monotonic val mark = timeSource.markNow() -//sampleEnd } ``` -{kotlin-runnable="true" kotlin-min-compiler-version="1.3" id="kotlin-time-mark-moment"} ### Measure differences in time diff --git a/docs/topics/tour/kotlin-tour-collections.md b/docs/topics/tour/kotlin-tour-collections.md index 9071489ef2b..26c7d5c86df 100644 --- a/docs/topics/tour/kotlin-tour-collections.md +++ b/docs/topics/tour/kotlin-tour-collections.md @@ -39,8 +39,13 @@ fun main() { //sampleStart // Read only list val readOnlyShapes = listOf("triangle", "square", "circle") + println(readOnlyShapes) + // [triangle, square, circle] + // Mutable list with explicit type declaration - val shapes: MutableList = mutableListOf("triangle", "square", "circle") + val shapes: MutableList = mutableListOf("triangle", "square", "circle") + println(shapes) + // [triangle, square, circle] //sampleEnd } ``` @@ -242,8 +247,13 @@ fun main() { //sampleStart // Read-only map val readOnlyAccountBalances = mapOf(1 to 100, 2 to 100, 3 to 100) + println(readOnlyAccountBalances) + // {1=100, 2=100, 3=100} + // Mutable map with explicit type declaration - val accountBalances: MutableMap = mutableMapOf(1 to 100, 2 to 100, 3 to 100) + val accountBalances: MutableMap = mutableMapOf(1 to 100, 2 to 100, 3 to 100) + println(accountBalances) + // {1=100, 2=100, 3=100} //sampleEnd } ``` diff --git a/docs/topics/tour/kotlin-tour-hello-world.md b/docs/topics/tour/kotlin-tour-hello-world.md index 59b89f17549..fd83a5d7050 100644 --- a/docs/topics/tour/kotlin-tour-hello-world.md +++ b/docs/topics/tour/kotlin-tour-hello-world.md @@ -49,6 +49,8 @@ fun main() { // Some customers leave the queue customers = 8 + println(customers) + // 8 //sampleEnd } ```