/**
 * This function takes a list of rooms and a target wall color as arguments.
 * It will iterate through each room and break out of the loop when it finds a room with the target wall color.
 * The function returns the name of the first room that has the target wall color.
 *
 * @param rooms A list of maps representing different rooms, where each map contains
 *              the room name and the wall color.
 * @param target The wall color to search for.
 *
 * @return The name of the first room with the target wall color, or null if no such room is found.
 */
fun findWallColors(rooms: List<Map<String, String>>, target: String): String? {

    for (room in rooms) {  // Iterate through each room in the list
        if (room.containsKey("wall_color") && room["wall_color"] == target) {  // Check if the room's wall color is the target
            return room["name"]  // Return the name of the room
        }
    }
    return null  // Return null if no room with the target wall color is found
}
/**
 * This function takes a list of rooms and a target wall color as arguments.
 * It will iterate through each room and break out of the loop when it finds a room with the target wall color.
 * The function returns the name of the first room that has the target wall color.
 *
 * @param rooms A list of maps representing different rooms, where each map contains
 *              the room name and the wall color.
 * @param target The wall color to search for.
 *
 * @return The name of the first room with the target wall color, or null if no such room is found.
 */
fun findWallColors(rooms: List<Map<String, String>>, target: String): String? {
/**
 * This function takes a list of rooms and a target wall color as arguments.
 * It will iterate through each room and break out of the loop when it finds a room with the target wall color.
 * The function returns the name of the first room that has the target wall color.
 *
 * @param rooms A list of maps representing different rooms, where each map contains
 *              the room name and the wall color.
 * @param target The wall color to search for.
 *
 * @return The name of the first room with the target wall color, or null if no such room is found.
 */
fun findWallColors(rooms: List<Map<String, String>>, target: String): String? {

    for (room in rooms) {  // Iterate through each room in the list
        if (room.containsKey("wall_color") && room["wall_color"] == target) {  // Check if the room's wall color is the target
            return room["name"]  // Return the name of the room
        }
    }
    return null  // Return null if no room with the target wall color is found
}