Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
// version 1.1.2
|
||||
|
||||
class SomeClass {
|
||||
val runtimeVariables = mutableMapOf<String, Any>()
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val sc = SomeClass()
|
||||
println("Create two variables at runtime: ")
|
||||
for (i in 1..2) {
|
||||
println(" Variable #$i:")
|
||||
print(" Enter name : ")
|
||||
val name = readLine()!!
|
||||
print(" Enter value : ")
|
||||
val value = readLine()!!
|
||||
sc.runtimeVariables.put(name, value)
|
||||
println()
|
||||
}
|
||||
while (true) {
|
||||
print("Which variable do you want to inspect ? ")
|
||||
val name = readLine()!!
|
||||
val value = sc.runtimeVariables[name]
|
||||
if (value == null) {
|
||||
println("There is no variable of that name, try again")
|
||||
} else {
|
||||
println("Its value is '${sc.runtimeVariables[name]}'")
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue