Skip to content
Advertisement

reduce javascript code (stack overflow 2022) [closed]

I’m doing this puzzle, and sometimes when I give a new game the pieces go wrong, I added a function for it and from what I see it doesn’t work, my head can’t take it anymore. And I would also like to simplify the code a bit, that’s why I asked before.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Something like this ought to work. Since I don’t know what you want to do with the results, I just put them in an array (cell_classes).

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement