/**
 * Given a string of game variable names and a list of corresponding values,
 * create a pair from the string and modify the elements of the list based on the pair.
 *
 * @param string A string of game variable names separated by commas.
 * @param variableValues A list of current variable values.
 * @return Pair created from the string and a modified list with elements replaced by corresponding values from the pair.
 */
fun modifyGameVariables(string: String, variableValues: MutableList<String>): Pair<List<String>, List<String>> {

    // Create a pair from the comma-separated string
    val variables = string.split(',').toList()

    // Modify the elements of the list based on the pair
    for (i in variableValues.indices) {
        variableValues[i] = variables[i % variables.size]
    }

    return variables to variableValues
}
/**
 * Given a string of game variable names and a list of corresponding values,
 * create a pair from the string and modify the elements of the list based on the pair.
 *
 * @param string A string of game variable names separated by commas.
 * @param variableValues A list of current variable values.
 * @return Pair created from the string and a modified list with elements replaced by corresponding values from the pair.
 */
fun modifyGameVariables(string: String, variableValues: MutableList<String>): Pair<List<String>, List<String>> {
/**
 * Given a string of game variable names and a list of corresponding values,
 * create a pair from the string and modify the elements of the list based on the pair.
 *
 * @param string A string of game variable names separated by commas.
 * @param variableValues A list of current variable values.
 * @return Pair created from the string and a modified list with elements replaced by corresponding values from the pair.
 */
fun modifyGameVariables(string: String, variableValues: MutableList<String>): Pair<List<String>, List<String>> {

    // Create a pair from the comma-separated string
    val variables = string.split(',').toList()

    // Modify the elements of the list based on the pair
    for (i in variableValues.indices) {
        variableValues[i] = variables[i % variables.size]
    }

    return variables to variableValues
}