Code:

```
Calculate the perimeter and the area of the garden
# and pay the fair price for that.
# The prices for fences and lawns.
fencePrice = 3 # per meter.
lawnPrice = 2 # per square meter.
# You need the foreman.
foreman = hero.findNearest(hero.findFriends())
corners = foreman.corners
# Get the information about the garden.
bottomLeft = corners.bottomLeft
topRight = corners.topRight
# Calculate the size of the garden.
width = topRight.x - bottomLeft.x
height = topRight.y - bottomLeft.y
# Find the perimeter of the garden (meters):
perimeter = (width + height) * 2
# Use fencePrice and calculate the fence cost:
fencePrice = perimeter / fencePrice
# Find the area of the garden (square meters):
area = width * height
# Use lawnPrice and calculate the lawn cost:
lawnPrice = area / lawnPrice
finalPrice = fencePrice + lawnPrice
# The total cost is the sum of the fence and the lawn costs
totalCost = finalPrice # Δ Update this with the final price!
hero.say("The total price is " + totalCost)
# Pay the bill.
foreman.bill(totalCost)
```

Error:

None, but it doesn’t succeed.

Link:

https://codecombat.com/play/level/how-much?

Lydia