/**
 * This function draws different shapes using nested if-else statements.
 * It executes the drawing block of code multiple times based on the given number of shapes and size.
 *
 * @param numShapes Number of shapes to be drawn.
 * @param shapeSize Size of each shape.
 */
fun drawShapes(numShapes: Int, shapeSize: Int) {

    repeat(numShapes) {
        print("Enter shape ('rectangle' or 'triangle' or 'circle'): ")
        val shape = readLine()

        when (shape) {
            "rectangle" -> {
                print("Enter width of the rectangle: ")
                val width = readLine()!!.toInt()
                print("Enter height of the rectangle: ")
                val height = readLine()!!.toInt()
                print("Enter color of the rectangle: ")
                val color = readLine()

                // Drawing block of code for a rectangle
                println("Drawing a rectangle with width=$width, height=$height, color=$color.")
            }
            "triangle" -> {
                print("Enter base length of the triangle: ")
                val base = readLine()!!.toInt()
                print("Enter height of the triangle: ")
                val triangleHeight = readLine()!!.toInt()
                print("Enter color of the triangle: ")
                val color = readLine()

                // Drawing block of code for a triangle
                println("Drawing a triangle with base=$base, height=$triangleHeight, color=$color.")
            }
            else -> println("Invalid shape entered.")
        }
    }
}
/**
 * This function draws different shapes using nested if-else statements.
 * It executes the drawing block of code multiple times based on the given number of shapes and size.
 *
 * @param numShapes Number of shapes to be drawn.
 * @param shapeSize Size of each shape.
 */
fun drawShapes(numShapes: Int, shapeSize: Int) {
/**
 * This function draws different shapes using nested if-else statements.
 * It executes the drawing block of code multiple times based on the given number of shapes and size.
 *
 * @param numShapes Number of shapes to be drawn.
 * @param shapeSize Size of each shape.
 */
fun drawShapes(numShapes: Int, shapeSize: Int) {

    repeat(numShapes) {
        print("Enter shape ('rectangle' or 'triangle' or 'circle'): ")
        val shape = readLine()

        when (shape) {
            "rectangle" -> {
                print("Enter width of the rectangle: ")
                val width = readLine()!!.toInt()
                print("Enter height of the rectangle: ")
                val height = readLine()!!.toInt()
                print("Enter color of the rectangle: ")
                val color = readLine()

                // Drawing block of code for a rectangle
                println("Drawing a rectangle with width=$width, height=$height, color=$color.")
            }
            "triangle" -> {
                print("Enter base length of the triangle: ")
                val base = readLine()!!.toInt()
                print("Enter height of the triangle: ")
                val triangleHeight = readLine()!!.toInt()
                print("Enter color of the triangle: ")
                val color = readLine()

                // Drawing block of code for a triangle
                println("Drawing a triangle with base=$base, height=$triangleHeight, color=$color.")
            }
            else -> println("Invalid shape entered.")
        }
    }
}