Gridmancer Redux : Perplexity complex

I know what they are trying to get me to do here, but i just can’t figure out the code…
Or at least, not without help
Honestly why make a level when you don’t bother giving us any hints to help solve it?
Maybe it’s because it’s in the end of the game, idk.

Here’s my code

// Welcome to Gridmancer!
// A relic of days long past, the puzzle returns!
// Your task is to collect all the coins.
// You are given special methods to help with hero task.
// hero.addRect(x, y, w, h) places a rectangle to collect coins.
// hero.removeRect(x, y) removes a previously added rectangle at the point.
// hero.navGrid is (basically) a 2-dimensional array containing "Coin" or "Wall"
// You must collect all coins under rectangles
// Rectangles cannot collide with themselves or walls
// You need to make at most 55 rectangles to beat hero level!
var grid = hero.navGrid;
function addRect(i){
    var yes = "Coin";
    var no = "Wall";
    var row = i;
    var y = i;
    var w = 0;
    for (var col = 0; col <= grid[row].length; col++){
        var pos = grid[row][col];
        if (pos == yes) {
            var x = col;
            w++;
            continue;
        } else if (pos == no){
            hero.addRect(x,y,w,1);
            w = 0;
            continue;
        }
    }
}

for (var i = 0; i < grid.length; i++){
    addRect(i);
    hero.wait(1);
}

Much needed help required here. High iq probably required (Which i probably don’t have)

Thanks in advance
Riley

take IQ tests then, i have 129 IQ

im just a 14 year old

Haha, right into my trap

I have 134 IQ and i’m 15

Also you’re meant to help thank you very much

You can say you’re better that me if you can find out how to use the vivid clarity properly (different game. just trying to get it is another problem in it of itself.)

dude then u should solve dis ez if you have 5 more iq than me

can’t really wrap my head around the concept tho…

i need some help

yo then that makes 3 of us…

@Valentino_Artawan I am no expert but you could change one of the i’s into j’s

Please avoid reviving topics, also, some users are no longer active.

1 Like