Skip to content

Commit

Permalink
update: add println to some tour examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahhaggarty committed Jul 24, 2023
1 parent 81361b6 commit 14f44de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 0 additions & 3 deletions docs/topics/time-measurement.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 12 additions & 2 deletions docs/topics/tour/kotlin-tour-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> = mutableListOf("triangle", "square", "circle")
val shapes: MutableList<String> = mutableListOf("triangle", "square", "circle")
println(shapes)
// [triangle, square, circle]
//sampleEnd
}
```
Expand Down Expand Up @@ -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<Int, Int> = mutableMapOf(1 to 100, 2 to 100, 3 to 100)
val accountBalances: MutableMap<Int, Int> = mutableMapOf(1 to 100, 2 to 100, 3 to 100)
println(accountBalances)
// {1=100, 2=100, 3=100}
//sampleEnd
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/topics/tour/kotlin-tour-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ fun main() {

// Some customers leave the queue
customers = 8
println(customers)
// 8
//sampleEnd
}
```
Expand Down

0 comments on commit 14f44de

Please sign in to comment.