The geometry of flowers help plz

help plz i need help

# You now have the Ring of Flowers! You can do:
# toggleFlowers(True/False) - turns flowers on or off.
# setFlowerColor("random") - can also be "pink", "red", "blue", "purple", "yellow", or "white".

# Here are some functions for drawing shapes:
# x, y - center of the shape
# size - size of the shape (radius, side length)
def drawCircle(x, y, size):
    angle = 0
    hero.toggleFlowers(False)
    while angle <= Math.PI * 2:
        newX = x + (size * Math.cos(angle))
        newY = y + (size * Math.sin(angle))
        hero.moveXY(newX, newY)
        hero.toggleFlowers(True)
        angle += 0.2

def drawSquare(x, y, size):
    hero.toggleFlowers(False)
    cornerOffset = size / 2
    hero.moveXY(x - cornerOffset, y - cornerOffset)
    hero.toggleFlowers(True)
    hero.moveXY(x + cornerOffset, y - cornerOffset)
    hero.moveXY(x + cornerOffset, y + cornerOffset)
    hero.moveXY(x - cornerOffset, y + cornerOffset)
    hero.moveXY(x - cornerOffset, y - cornerOffset)


redX = {"x": 28, "y": 36}
whiteX = {"x": 44, "y": 36}

# Pick a color.
redX
# Draw a size 10 circle at the redX.

# Change the color!
whiteX
# Draw a size 10 square at the whiteX.

# Now experiment with drawing whatever you want!

Can you please format you code correctly using the

</> button please.

never mind my father help me i will let you know if i need help with another level.

Here you should use the method:

hero.setFlowerColor("whatever color you want")

Then here you need to use the premade function drawCircle and put in redX.x as x, redX.y as y and 10 as the size

Then you use hero.setFlowerColor again here

Here you use the other premade function drawSquare where whiteX.x is the x and whiteX.y is the y and 10 as size

1 Like