/**
 * This function creates a pattern using list comprehension and a while loop.
 *
 * @param designWidth The width of the design.
 * @param designHeight The height of the design.
 * @param numPatternLayers The number of layers in the pattern.
 * @param patternColor The color of the pattern.
 * @return List representation of the pattern.
 */
fun createPattern(designWidth: Int, designHeight: Int, numPatternLayers: Int, patternColor: String): List<List<String>> {

    val pattern = mutableListOf<String>()
    var layer = 1
    while (layer <= numPatternLayers) {
        // Loop until the desired number of layers is reached
        pattern.addAll(List(designWidth * layer) { patternColor })
        layer++
    }

    return pattern.chunked(designWidth)
}
/**
 * This function creates a pattern using list comprehension and a while loop.
 *
 * @param designWidth The width of the design.
 * @param designHeight The height of the design.
 * @param numPatternLayers The number of layers in the pattern.
 * @param patternColor The color of the pattern.
 * @return List representation of the pattern.
 */
fun createPattern(designWidth: Int, designHeight: Int, numPatternLayers: Int, patternColor: String): List<List<String>> {
/**
 * This function creates a pattern using list comprehension and a while loop.
 *
 * @param designWidth The width of the design.
 * @param designHeight The height of the design.
 * @param numPatternLayers The number of layers in the pattern.
 * @param patternColor The color of the pattern.
 * @return List representation of the pattern.
 */
fun createPattern(designWidth: Int, designHeight: Int, numPatternLayers: Int, patternColor: String): List<List<String>> {

    val pattern = mutableListOf<String>()
    var layer = 1
    while (layer <= numPatternLayers) {
        // Loop until the desired number of layers is reached
        pattern.addAll(List(designWidth * layer) { patternColor })
        layer++
    }

    return pattern.chunked(designWidth)
}