/**
 * This exercise focuses on a game developer's skill to modify the coordinates of game elements using a for loop.
 *
 * The 'coordinates' parameter is a list containing the coordinates (x, y) of several game elements. Your task is to modify the second element's x-coordinate by adding 10 to its current value.
 *
 * Complete the code below to solve the exercise.
 */
fun modifyElementCoordinates(coordinates: MutableList<Pair<Int, Int>>): MutableList<Pair<Int, Int>> {

    for (index in coordinates.indices) {
        if (index == 1) {
            val coord = coordinates[index]
            coordinates[index] = Pair(coord.first + 10, coord.second)
        }
    }
    return coordinates
}
/**
 * This exercise focuses on a game developer's skill to modify the coordinates of game elements using a for loop.
 *
 * The 'coordinates' parameter is a list containing the coordinates (x, y) of several game elements. Your task is to modify the second element's x-coordinate by adding 10 to its current value.
 *
 * Complete the code below to solve the exercise.
 */
fun modifyElementCoordinates(coordinates: MutableList<Pair<Int, Int>>): MutableList<Pair<Int, Int>> {
/**
 * This exercise focuses on a game developer's skill to modify the coordinates of game elements using a for loop.
 *
 * The 'coordinates' parameter is a list containing the coordinates (x, y) of several game elements. Your task is to modify the second element's x-coordinate by adding 10 to its current value.
 *
 * Complete the code below to solve the exercise.
 */
fun modifyElementCoordinates(coordinates: MutableList<Pair<Int, Int>>): MutableList<Pair<Int, Int>> {

    for (index in coordinates.indices) {
        if (index == 1) {
            val coord = coordinates[index]
            coordinates[index] = Pair(coord.first + 10, coord.second)
        }
    }
    return coordinates
}