Cubic Minefield - adventurer feedback

Pretty good level!

I’ve noticed this comment seems superfluous, and perhaps misleading:

# Complete the function. It must return the cube of the base

I believe you can just remove that comment, as there is already another comment right above the power function that gives the correct guidance:

# This function returns the number to the exponent power.

Also, if the goal of these levels is to get players to implement these algorithms from scratch, perhaps you could blacklist things like JavaScript’s Math.pow() and Python’s exponentiation operator (**).

When i run the code, it brings me an error saying: you do not have an item equipped with the findFriends skill

@youssef_asham You may need better glasses.

All the above, plus:

  • is it Cubic Minefield or Exponential Minefield?
    "# To find the path use a cubic equation"
    "# This function returns the number to the exponent power."
    "# Complete the function. It must return the cube of the base"

  • language revision needed:
    "# This function returns the number multiplied by the times"
    "# Don’t change the follow code"

NB: a well placed return number**exponent solves the level :wink:

@Bryukh: I still see some of the above-mentioned typos (“follow”, “the times”).

Plus, the python sample code uses self instead of hero (I didn’t check js).

And you may “encrypt” the don’t-change-this section a bit, e.g.:

h=hero;t=h.findFriends()[0];a,b,c,d,x,p=t.a,t.b,t.c,t.d,h.pos.x,power;while 1:
 y=a*p(x,3)+b*p(x,2)+c*p(x,1)+d*p(x,0);h.moveXY(x,y);x+=5

Oh, and ** is still available…

is it Cubic Minefield or Exponential Minefield

“Cubic” because it’s Cubic equation.

Plus, the python sample code uses self instead of hero (I didn’t check js).

Will fix.

And you may “encrypt” the don’t-change-this section

mmm, I think it’s not a good idea, we prefer to use readable code.

Oh, and ** is still available…

I know :wink:

My bad: I was not aware that 3rd degree equations are called “cubic”… :wink:

Please don’t post working code, as it may ruin the learning experience for others.

On the other hand, using an available, built-in feature (which was already mentioned in this same thread half a year ago) is far from being a “hack” :smirk:

Oops… Sorry about that. Is there any way to delete it?

can you help me with my code?