-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathUsage.kt
46 lines (42 loc) · 833 Bytes
/
Usage.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package co.zsmb.villagedsl.advanced.dsl1
fun main() {
val v = village {
house {
person {
name = "Alice"
age = 31
}
person {
name = "Bob"
age = 45
}
gold {
amount = 500
}
}
house {
sword {
strength = 24.2
}
sword {
strength = 16.7
}
shield {
defense = 15.3
}
}
house()
house {
gold {
amount = 2500
}
sword()
shield {}
person {
name = "Charles"
age = 52
}
}
}
print(v)
}