You can naturally reuse all the code you typed in previous exercise (select the other exercise, do Ctrl-C, come back to the code of this exercise, do Ctrl-V).
But you want to keep your code as simple as possible. For that, define new
methods to deal simply with the repetitions in the pattern. For example, a method
makePattern()
achieving the pattern of previous example seems to
be a good idea (but this may not be enough).
Why don't you give it a shot? The main code method shouldn't take more than 2 lines (included in a for loop)