Cubic Minefield - adventurer feedback


#1

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 (**).


#2

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


#3

@youssef_asham You may need better glasses.


#4

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:


#5

@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…


#6

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:


#7

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


#9

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:


#10

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


#11

can you help me with my code?