Is implementing something like this possible?

Hello everyone I am trying a code below which takes the index of for loop and append that index as a suffix to variable name and give that variable the loop iteration value . Obviously doesn’t work but is it even possible?

fun main() {
var x1 = 0
var x2 = 0
var x3 = 0
for (i in 1..3){
xi = i
println(xi)
}
}

submitted by /u/unholy182000
[link] [comments]