# Need help with "Mad Maxer"

I’m stuck on this level. The farthest enemy is Gurzthrot, but he has so many lives that when my hero tries to kill him, all the other enemies kill me first.

what is your health, your sword, and what code are you using?

@Eventous
Health: 935
Sword: Simple Sword (Long Sword is restricted)
Coding Language (if that’s what you meant by “code”): Python

1 Like

I would approximate that it would take around 3000 health to do the level properly with the simple sword (even more if you didn’t attack furthest first).

You need a better weapon.
Darksteel, I use up ~560 health (I would guess Great or Claymore should be around here, healthwise)
Kithsteel, I use ~400 health

You might be able to do it with the short sword, but I wouldn’t even attempt anything lower (I don’t think I’d spend the money just to find out on the short sword unless that is really all you can afford…), and would suggest you go as high as you reasonably can.

1 Like

Yeah, you are going to need a better sword, I used the Kithsteel. And I meant what is the actual code you are using.

@Eventous @Vlevo
This is my code:

``````

# Kill the enemy that's farthest away first.

loop:
farthest = None
maxDistance = 0
enemyIndex = 0
enemies = self.findEnemies()

# Look at all the enemies to figure out which one is farthest away.
while enemyIndex < len(enemies):
target = enemies[enemyIndex]
enemyIndex += 1

# Is this enemy farther than the farthest we've seen so far?
distance = self.distanceTo(target)
if distance > maxDistance:
maxDistance = distance
farthest = target

if farthest:
# Take out the farthest enemy!
# Keep attacking the enemy while its health is greater than 0.
while farthest.health>0:
self.cleave(farthest)
else:
self.attack(farthest)
``````

The reason I use Simple Sword is because Long Sword is restricted.
Also, I have 832 gems. So I can’t by too much.

This is the code I used :

[code]
loop:
maxDistance = 0
enemyIndex = 0
enemies = self.findEnemies()

``````while enemyIndex < len(enemies):
target = enemies[enemyIndex]
enemyIndex += 1

distance = self.distanceTo(target)
if distance > maxDistance:
maxDistance = distance
farthest = target

if farthest:
self.attack(farthest)
farthest = None
``````

[/code] My friend is having the same issue with the same level because his sword isnt strong enough, but doesnt have money. I think there should be an option to sell items though…

Well, you could always simulate games. Simulating games earns you 20x^0.4 gems, where x is the number go games you have simulated. This should earn you a hew hundred relatively quickly. Try this: http://codecombat.com/play/ladder/cavern-survival#simulate

I’ve managed to slay the ogres, but when I try to slay the dummies it doesn’t work. Please help!

mine is this
Health: 246.20
Sword: Sword of the forgotton
Damage: 126.88
Coding Language: Python

I dont mean to brag, but I have 4852 gems, just saved them.

Please do not revive dead topics by posting unrelated things to an inactive user

1 Like

the variable is “target” not “farthest”

try this:

while True:
farthest = None
maxDistance = 0
enemyIndex = 0
enemies = hero.findEnemies()
while enemyIndex < len(enemies):
target = enemies[enemyIndex]
enemyIndex += 1
distance = hero.distanceTo(target)
if distance > maxDistance:
maxDistance = distance
farthest = target
if farthest:
while farthest.health > 0:
hero.attack(farthest)