Challenge 10... wut?


#1

Falling further and further behind because I try really hard not to use technology on my weekends (I work with the crap all week, I like doing real stuff on my time off, thanks) so I’m only up to Challenge 10. Also the drip-feed “one Challenge per day no matter what” thing is BS, but we all know that, right?

Anyway.

Challenge 10… every other post on it has been so ruthlessly trimmed for “posting solutions” by the admins here that they’re utterly useless for actual assistance anymore.

function lightRow(row){
return GRID[row].toString;
}

…should spit back the relevant sub-array that is a row, except that it apparently doesn’t.

WTF am I missing?


#2

You want to return an array, so the toString is not needed.

Also the way the row number is sent to you is based off the graphical GRID, and the coded GRID is an array, which is zero based.

          +---+---+---+---+---+---+---+---+---+---+
1 = 0  |   |   |   | ^ |   |   |   |   |   |   |
         +---+---+---+---+---+---+---+---+---+---+
2  = 1  |   |   | v |   | ~ |   |   |   |   |   |
         +---+---+---+---+---+---+---+---+---+---+
3 = 2  |   | v |   |   | ^ | ^ |   |   |   |   |

etc.


#3

row - 1

Yay. Zero-based math is weird and apparently still breaks my mind.