/**
 * You are a game developer and want to modify a specific element in the list of game objects.
 *
 * Write a function that takes three parameters:
 * - gameObjects: A list of game objects, which can be of any type.
 * - index: An integer representing the index of the element you want to modify.
 * - value: The new value you want to set for the element at the given index.
 *
 * Your task is to modify the element at the specified index in the gameObjects list to the provided value.
 * If the given index is out of range, return the original gameObjects list without any modifications.
 *
 * Example:
 * gameObjects = listOf("enemy", "player", "obstacle")
 * index = 1
 * value = "npc"
 *
 * modifyGameObjects(gameObjects, index, value)
 *
 * Output:
 * ["enemy", "npc", "obstacle"]
 */
fun modifyGameObjects(gameObjects: MutableList<String>, index: Int, value: String): List<String> {

    if (index < 0 || index >= gameObjects.size) {
        return gameObjects
    }

    gameObjects[index] = value
    return gameObjects
}
/**
 * You are a game developer and want to modify a specific element in the list of game objects.
 *
 * Write a function that takes three parameters:
 * - gameObjects: A list of game objects, which can be of any type.
 * - index: An integer representing the index of the element you want to modify.
 * - value: The new value you want to set for the element at the given index.
 *
 * Your task is to modify the element at the specified index in the gameObjects list to the provided value.
 * If the given index is out of range, return the original gameObjects list without any modifications.
 *
 * Example:
 * gameObjects = listOf("enemy", "player", "obstacle")
 * index = 1
 * value = "npc"
 *
 * modifyGameObjects(gameObjects, index, value)
 *
 * Output:
 * ["enemy", "npc", "obstacle"]
 */
fun modifyGameObjects(gameObjects: MutableList<String>, index: Int, value: String): List<String> {
/**
 * You are a game developer and want to modify a specific element in the list of game objects.
 *
 * Write a function that takes three parameters:
 * - gameObjects: A list of game objects, which can be of any type.
 * - index: An integer representing the index of the element you want to modify.
 * - value: The new value you want to set for the element at the given index.
 *
 * Your task is to modify the element at the specified index in the gameObjects list to the provided value.
 * If the given index is out of range, return the original gameObjects list without any modifications.
 *
 * Example:
 * gameObjects = listOf("enemy", "player", "obstacle")
 * index = 1
 * value = "npc"
 *
 * modifyGameObjects(gameObjects, index, value)
 *
 * Output:
 * ["enemy", "npc", "obstacle"]
 */
fun modifyGameObjects(gameObjects: MutableList<String>, index: Int, value: String): List<String> {

    if (index < 0 || index >= gameObjects.size) {
        return gameObjects
    }

    gameObjects[index] = value
    return gameObjects
}