Cube Matcher - Confused about fixing this game

https://www.codecademy.com/paths/create-video-games-with-phaser/tracks/game-dev-learn-javascript-higher-order-functions-and-iterators/modules/game-dev-project-iterators/projects/cube-matcher

I’ve done steps 1 and 2. They are quite easy as they require you to just locate things. I’m completely stuck on step 3. I have no idea what to code. Can someone help me out?

Hi! Iterators are messing with me too, but to do this part is to look at what you are trying to do with the code. We went through (col) now we want to go through (row) and find each square that way as they did before. Check the directions and see how we’re basically doing the same thing but in a different direction :slight_smile:

I’m also having trouble with this, and not even the code provided in the solutions is working, this is what i have:

return board.map((col, i) => {

      return col.map((row, j) => {

        return this.makeCube(i,j)});

    });

I have no idea what the heck I am supposed to do with steps 3 and 4, did you figure out the solution? The project site on Codecademy won’t give me a solution to help me figure out this puzzle.

Welcome, @armanterrell7947.

You didn’t skip past the unit on iterators, by any chance? There is some lesson narrative on the Array.map() method and some practice as well. Maybe go back over the basics and review to get up to speed for this project. It is not a lesson, and has no built in checking, so we’re on our own. Go back and sharpen up your skills.

Hey MTF. I actually went back through it and was just confused about it! After about an hour I was able to get the code to execute with:

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

Sorry for poor formatting, not sure how to indent on the comment tab.

Alright! Now you’re making headway. Remember to go back to the lessons if you hit another snag. Review and practice are the best teachers once we’ve been given the fundamentals.

As for formatting, paste in your code sample, select it again and click the </> button in the tool tray of the post editor.

You’re the king! Thank you brother.

1 Like