# Collect 4 gems. Don't touch gems from the inner circle.
# The radius of the gem-trap circle.
innerRadius = hero.distanceTo(hero.findNearestItem())
# This function check that a is definitely greater than b.
def definitelyGreater(a, b):
return a > b + 0.5
gems = hero.findItems()
# Iterate all gems:
for gem in gems:
# Use definitelyGreater to check if a gem's distance
# is greater than the inner radius:
if (definitelyGreater > innerRadius):
hero.move(gem.pos)
hero.moveXY(40, 34)
# Collect 4 gems. Don't touch gems from the inner circle.
# The radius of the gem-trap circle.
innerRadius = hero.distanceTo(hero.findNearestItem())
# This function check that a is definitely greater than b.
def definitelyGreater(a, b):
return a > b + 0.5
gems = hero.findItems()
# Iterate all gems:
for gem in gems:
# Use definitelyGreater to check if a gem's distance
# is greater than the inner radius:
if (definitelyGreater > innerRadius):
hero.move(gem.pos)
hero.moveXY(40, 34)
into this
# Collect 4 gems. Don't touch gems from the inner circle.
# The radius of the gem-trap circle.
innerRadius = hero.distanceTo(hero.findNearestItem())
# This function check that a is definitely greater than b.
def definitelyGreater(a, b):
return a > b + 0.5
gems = hero.findItems()
# Iterate all gems:
for gem in gems:
# Use definitelyGreater to check if a gem's distance
# is greater than the inner radius:
if (definitelyGreater(something, something) > innerRadius):
hero.move(gem.pos)
hero.moveXY(40, 34)
You need to enter the parameters for any input function. if you use definitelyGreater, it will give you nothing (0). So, it will not work