/**
 * This function retrieves the value of a variable at a specified index.
 *
 * @param name The name of the variable.
 * @param index The index at which to retrieve the value.
 * @return The value of the variable at the specified index.
 */
fun getVariable(name: String, index: Int): Int? {

    val variables = mapOf(
        "temperature" to listOf(20, 25, 30, 28, 22),
        "humidity" to listOf(45, 50, 55, 60, 62),
        "oxygen_levels" to listOf(15, 17, 16, 14, 19)
    )

    // If the name is not in the variables dictionary, return null
    if (!variables.containsKey(name)) {
        return null
    }

    // If the index is out of range, return null
    if (index < 0 || index >= variables[name]?.size ?: 0) {
        return null
    }

    // Retrieve the value of the variable at the specified index
    return variables[name]?.get(index)
}
/**
 * This function retrieves the value of a variable at a specified index.
 *
 * @param name The name of the variable.
 * @param index The index at which to retrieve the value.
 * @return The value of the variable at the specified index.
 */
fun getVariable(name: String, index: Int): Int? {
/**
 * This function retrieves the value of a variable at a specified index.
 *
 * @param name The name of the variable.
 * @param index The index at which to retrieve the value.
 * @return The value of the variable at the specified index.
 */
fun getVariable(name: String, index: Int): Int? {

    val variables = mapOf(
        "temperature" to listOf(20, 25, 30, 28, 22),
        "humidity" to listOf(45, 50, 55, 60, 62),
        "oxygen_levels" to listOf(15, 17, 16, 14, 19)
    )

    // If the name is not in the variables dictionary, return null
    if (!variables.containsKey(name)) {
        return null
    }

    // If the index is out of range, return null
    if (index < 0 || index >= variables[name]?.size ?: 0) {
        return null
    }

    // Retrieve the value of the variable at the specified index
    return variables[name]?.get(index)
}