Cube Matcher step 3 and 4

I’m struggling in step 3 and 4 of the Cube Matcher exercise of the “Create video games with phaser” course.
https://www.codecademy.com/paths/create-video-games-with-phaser/tracks/game-dev-learn-javascript-higher-order-functions-and-iterators/modules/8ad12b913cae87daa85df0ff4275697a/projects/cube-matcher

This is the code i added inside makeBoard(size) {

return board.map((col, i) => {
      return col.map((row, j) => {
        return this.makeCube(i,j)});
    });

but nothing changes in the board as suggested in step 5. Just a black board with one green triangle on the top left corner as before. I also tried the code provided in the solutions:

return board.map((col, i) => {
      return col.map((row, j) => this.makeCube(i, j));
    });

but also doesn’t work

I am stuck on this project as well… Step 8 is making my head spin.

For step 3, think about which array you are calling .map() on. The explanation of the step (not the hint) gives a better idea of what that line should look like. Hope that helps!

return board.map((col, i) => {
return col.map((row, j) => {
return this.makeCube(i, j);
worked for me

1 Like