code / tomo-koans

Lines447 Tomo432 INI9 Markdown6
(29 lines)
1 # Text
3 func main()
5 # Text values are sequences of letters.
6 greeting := "Hello"
8 assert greeting.length == ???
10 # Text supports interpolation with `$`:
11 name := "Alice"
12 message := "Hello $name, your number is $(1 + 2)"
14 assert message == ???
16 # Multi-line text uses indented quotes:
17 multiline := "
18 line one
19 line two
20 line three
23 # Method calls use `.`
24 assert multiline.lines() == [???]
26 # Common text methods:
27 assert "hello".upper() == ???
29 assert "hello world".split(" ") == [???]