# [SOLVED] Danger Picklock

``````# You need to break the door.

# The function checks the equality with 5% inaccuracy.
def almostEqual(a, b):
return Math.abs(a - b) < (b * 0.05)

# We have a bomb for the door, but it's weak.
bomb = hero.findByType("robobomb")[0]
# Wizards can charge the bomb.
wizards = hero.findByType("wizard")
# The area of a circle should be equal:
chargeArea = bomb.chargeArea
while True:
# Find the current area of the circle.
# If it's almost equal to chargeArea:

``````

`area` needs to be `almostEqual` to `chargeArea`
~ Orb

what do you mean(20chars)

I mean the area you just defined should be almost equal to the charge area defined above
~ Orb

like this
area = almostEqual * chargeArea * Math.PI

No, no
if `almostEqual(area, chargeArea)`, then you tell the wizards that the bomb is charged enough.
~ Orb

4 Likes

Thank you that worked

(/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/ (/โใฎโ)/
~ Orb

thank you so much iโm now level 38

4 Likes

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.