Challenge 20: Code producing correct results in online editor, but showing error in challenge [SOLVED]


#1

I tried my code out in a online editor and it works, but when I put it in the challenge and click submit it shows the error “Your code ran but did not produce the correct result.” Can anyone help me figure out why this isn’t working? Thanks in advanced! This is my first time coding in Javascript so I am fairly new to this.


#2

I’m not too sure if you are returning the right result. I’m just cross-referencing on the last line. Here’s the result fo my code:

[ [ 0, 0, 0, 100, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 50, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 100, 100, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 100, 100, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
[ 0, 100, 50, 50, 0, 0, 0, 100, 0, 0 ],
[ 0, 100, 0, 50, 50, 0, 0, 0, 0, 0 ],
[ 0, 100, 0, 0, 50, 50, 0, 0, 0, 0 ] ]

#3

Thank you! The last line was incorrect. There was a problem with my lightCell function, but it is fixed now.