Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Range Finder, please help Python

Mod edit: Please do not request solutions. The purpose of this board is to assist people with their code. Simply providing solutions is counter productive to the learning process. There are many people here willing and able to assist you with your code but we do not just give the answers. Thanks.

We do not request or give solutions in here. Please post your code according to the FAQ so we can assist you.

sorry im new, but can you please help ive been stuck for weeks

26%20PM

First you have to make hero.distanceTo(enemy4) a variable. Then you have to say the distance to enemy 4

1 Like

how do you make it variable

Please actually make an effort to learn. Please look at the code for enemy1 and do the same format for enemy4.

1 Like

no u yeet!!!

I’m just only trying to help. You are using little effort and making it harder for me to help you. This level requires little effort and just telling you how to make a variable is literately telling the solution. Please review the dungeon or the early forest levels and try this level again.

i am just kidding

just hero.distanceTo(enemy4) will do nothing except that the hero (aka, the computer) will calculate the current distance. variable is like what you did for enemy. instead of keeping hero.findNearestEnemy() as itself, you abbreviated it to enemy. so then, what will you name your distance to enemy4?

I’m pretty sure that this person’s problem has been solved already.