White Rabbit - (Can't Catch It)


#1

I believe some weird things are happening in this level. I’m writing in JS.

This code I believe should be working, but my hero stops halfway like it can’t understand where the lightstone went.:

// Follow the lightstone to navigate the traps.

while (true) {
    var item = hero.findNearestItem();
    if (item) {
        // Store the items position in a new variable using item.pos:
        var itemPos = item.pos;
        // Store the X and Y coordinates using pos.x and pos.y:
        var itemX = itemPos.x;
        var itemY = itemPos.y;
        // Move to the coordinates using moveXY() and the X and Y variables:
        hero.moveXY(itemX, itemY);
    }
}

However, it doesn’t work as it’s supposed to. Seems to only work when I make the hero.move(itemPos) to bypass the variables:

// Follow the lightstone to navigate the traps.

while (true) {
    var item = hero.findNearestItem();
    if (item) {
        // Store the items position in a new variable using item.pos:
        var itemPos = item.pos;
        // Store the X and Y coordinates using pos.x and pos.y:
        var itemX = itemPos.x;
        var itemY = itemPos.y;
        // Move to the coordinates using moveXY() and the X and Y variables:
        hero.move(itemPos);
        //Bypass all the variable storing in the middle and just hero.move to itemPos
    }
}


#2

When you do move it partialy moves there. But the moveXY command moves to the exact pos of the item @Eric_Kidwell


#3

So how do I store the item’s exact position so that the hero moves there instead of it’s partial position?

Here’s what the first code example ends up looking like:

ie:

// Follow the lightstone to navigate the traps.

while (true) {
    var item = hero.findNearestItem();
    if (item) {
        // Store the items position in a new variable using item.pos:
        var itemPos = item.pos;
        // Store the X and Y coordinates using pos.x and pos.y:
        var itemX = itemPos.x;
        var itemY = itemPos.y;
        // Move to the coordinates using moveXY() and the X and Y variables:
        hero.moveXY(itemX, itemY);
    }
}

#4
hero.moveXY(item.pos.x, item.pos.y);

#5

Yeh, I would expect that to work as an alternative to storing in variables the x and y position, however, it get’s teh same results as the comment suggested way of doing it with variables.


#6

Mabye is is an equipment problem The lightstone could be to far away for the hero to see. i used the same code and it worked fine because i hade the best glasses


#7

That be true since I only have the 2nd pair that the game gives.

However, when I pause to say the item’s position, then it get’s further into the maze, but loses due to time. Which would tell me that the hero should be able to see it (range) around the corner if he can get that far.


#8

Mabye you can get the ring of speed to make you faster


#9

Sure, I’ll try that. I’ve already got the maxspeed boots.


#10

The softened leather boots is a little faster. Try that


#11

I tried to replicate your error but failed. I passed the level using a knight, slowest boots, your glasses and your code. I have similar error on https://codecombat.com/play/level/mountain-flower-grove? ( RUN OUT OF TIME) but I suppose I will never finish it with 2GB RAM. Clear your cash, restart Windows.


#12

Dang only 2GB? What pc do u use?


#13

12 years old machine on windows 7. But it runs Dota 2, a bunch of photo manipulating programs and certainly Codecombat without Mountain Flower Grove level. I’m pretty sure I will pass it storing all points in an array and then drawing something.


#14

Make your hero run around in a while True loop. Then for submission just press skip

or use jump boots so it takes less time to run 1000 blocks. Also use Pender and Ring of speed and cast haste on yourself. Try that.


#15

My son definitely will use Pender, he’s a subscriber, I’m not. I tried running aimlessly, skip and ring of speed without success. But jump boots - nice idea! :wink:


#16

Or you could just go and buy yourself a better computer or a new memory disc. (i heard they released 2TB memory discs)


#17

Storage and memory are different memory’s are usually about 8gb to 32 go, and storage is about 512 go to 1tb