Code Sketch


sangeeta_Activity2 20Oct
By: Sangeeta Salgaonkar
cleari()
showAxes()
setPenColor(blue)
setPenThickness(10)

def plus(side: Int, size: Int) =
    {
        if (side <= 0) {}
        else {
            repeat(side) {
                forward(size)
                hop(-size)
                right()
            }

        }

    }

def square(side: Int, size: Int) =
    {
        if (side <= 0) {}
        else {
            repeat(side) {
                right()
                forward(size)

            }

        }

    }

setFillColor(pink)
setPosition(-100, 100)

square(4, 200)

setPosition(0, 0)
plus(4, 100)