Boolean variable true and false en kotlin

why if a boolean value is declared true in this exercise, then we call it false Shouldn’t it keep its value true because Is this how we declare it in the variable?

fun main(parametro: Array) {
val arreglo = IntArray(10)
for(i in 0…arreglo.size-1) {
print(“Ingrese elemento:”)
arreglo[i] = readLine()!!.toInt()
var ordenado = true
for(i in 0…arreglo.size-2)
if (arreglo[i+1] < arreglo[i])
ordenado = false
if (ordenado)
print(“Los elementos están ordenados de menor a mayor”)
print(“Los elementos no están ordenados de menor a mayor”)

Variables can change. Yes, when you first declare the variable you initialize it to true. But later you set ordenado to false. So why should it keep it’s original value. If you don’t want it to change you can declare it as a val(value). That means it can only be set once, so the line ordenado = false would create an compiler error.