Your goal (here and in any well written program) is to write the simplest possible code. For that, you have to decompose your work in sub-steps, and write a specific method for each sub-step.
If you observe carefully the picture to draw, it is constituted of four
parts depicting a sort of V. A possible decomposition is to write a method
in charge of drawing a V from the current position. Its prototype can be:
[!java|c]void [/!]makeV()
In this method, you should use the methods brushUp()
and
brushDown()
to mark the ground (you may want to factorize this in another
method). It may be wise to write the makeV()
so that it places directly
the buggle in position for the next V.
Your turn. Your code should not be longer than 4 lines (not counting
makeV
)...