7.12 Iterating over Multidimensional Arrays


I have code that misses the point of the exercise and is flagged as okay.

s.each { |element| puts element }

This is not what the lesson requires, but I got lazy and noticed it works and felt guilty and noticed the real solution was something else. I noticed this doesn't have feedback in-lesson like other courses, so whom can I alert about this? Thanks!


Not really anyone, sadly.

Note that puts is iterating through each element though, so whether that's satisfactory or not is up to the degree of detail you feel like you should be spelling out the actions that need to happen. You don't need to look at intended solutions for that, consider what should happen and whether you wrote all of that, judge for yourself.


Thanks, yeah, I figure they can't be perfect about that sort of thing. It was worth trying both solutions, the intended one and the shortcut, just to get a feel for things.

The instructions still give good enough guides without spoiling anything, but I figured just in case people cut corners like I did...


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.