/**
 * This function takes a dictionary of game object types and their corresponding quantities, and an integer count as input.
 * It returns a list of game objects based on the dictionary where each game object type is repeated count number of times,
 * with their quantities preserved.
 *
 * @param objects A dictionary with game object types (keys) and their corresponding quantities (values).
 * @param count An integer representing the number of times each game object type should be repeated.
 * @return A list of game objects with preserved quantities.
 */
fun createGameObjects(objects: Map<String, Int>, count: Int): List<String> {

    val gameObjectsList = mutableListOf<String>()
    for ((obj, quantity) in objects) {
        val repeatedObjects = List(count) { obj }  // List repetition
        gameObjectsList.addAll(List(quantity) { repeatedObjects }.flatten())  // Concatenation of repeated objects
    }
    return gameObjectsList
}
/**
 * This function takes a dictionary of game object types and their corresponding quantities, and an integer count as input.
 * It returns a list of game objects based on the dictionary where each game object type is repeated count number of times,
 * with their quantities preserved.
 *
 * @param objects A dictionary with game object types (keys) and their corresponding quantities (values).
 * @param count An integer representing the number of times each game object type should be repeated.
 * @return A list of game objects with preserved quantities.
 */
fun createGameObjects(objects: Map<String, Int>, count: Int): List<String> {
/**
 * This function takes a dictionary of game object types and their corresponding quantities, and an integer count as input.
 * It returns a list of game objects based on the dictionary where each game object type is repeated count number of times,
 * with their quantities preserved.
 *
 * @param objects A dictionary with game object types (keys) and their corresponding quantities (values).
 * @param count An integer representing the number of times each game object type should be repeated.
 * @return A list of game objects with preserved quantities.
 */
fun createGameObjects(objects: Map<String, Int>, count: Int): List<String> {

    val gameObjectsList = mutableListOf<String>()
    for ((obj, quantity) in objects) {
        val repeatedObjects = List(count) { obj }  // List repetition
        gameObjectsList.addAll(List(quantity) { repeatedObjects }.flatten())  // Concatenation of repeated objects
    }
    return gameObjectsList
}