Challenge 13 not pass? {solved}


#1

On my editor, output looks same as the sample,

allRocks()
[ ‘D1’, ‘E3’, ‘F3’, ‘E4’, ‘F4’, ‘B8’, ‘H8’, ‘B9’, ‘B10’ ]
allCurrents()
[ ‘E2’, ‘C8’, ‘D8’, ‘D9’, ‘E9’, ‘E10’, ‘F10’ ]

but the tester says
“Your code ran but did not produce the correct result.”

Did anyone have the same situation? and solved?
or am I missing something? …like, data type, edge case, etc?


#2

I’m getting the exact same issue. Did you manage to solve yours?


#3

Can you post your code?


#4

My bad, I figured it out. Accidentally copied the GRID back over from my codepen to the LL submission. Removed that, worked fine :slight_smile:


#5

Ok! just a moment please


#6

Congrats! I haven’t solved yet


#7
const GRID = [
["", "", "", "^", "", "", "", "", "", ""],
["", "", "v", "", "~", "", "", "", "", ""],
["", "v", "", "", "^", "^", "", "", "", ""],
["", "", "", "", "^", "^", "", "", "", ""],
["", "", "", "", "", "", "", "", "v", ""],
["", "", "", "", "", "", "", "", "", ""],
["", "", "", "", "", "", "", "", "", ""],
["", "^", "~", "~", "", "", "", "^", "", ""],
["", "^", "", "~", "~", "", "", "", "", ""],
["", "^", "", "", "~", "~", "", "", "", ""],
  ];
///////////////////////////////////////

function allRocks() {
    var cell = [];
    for (var ii = 0; ii < countRows(); ii++) {
        for (var jj = 0; jj < countColumns(); jj++) {
                var coordinatePoint = String.fromCharCode(jj + 65) + (ii + 1);
                if (isRock(coordinatePoint)) {
                    cell.push(coordinatePoint);
                }
        }
    }
    return cell;
}

#8

must use filter by any chance…?


#9

I changed to use map, then passed!


#10

What did you change to use map? I’m in a similar situation to you: my output seems to work, but the website doesn’t accept it.


#12

Actually, I used map for just looping. (so, forEach also works same)
It passed, but maybe I should use a return of map or filter directly.