Il tuo scopo (quì come in ogni altro programma ben scritto) è di produrre codice più semplice possibile. Per far questo devi scomporre il lavoro in sottosezioni e scrivere un metodo specifico per ognuna di esse.
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 questo metodo dovresti inserire a loro volta i metodi
brushUp()
e brushDown()
per marcare il terreno
(possibilmente fattorizzando anche loro in un ulteriore metodo). Potrebbe
essere saggio scrivere makeV()
in modo tale che alla fine
predisponga il buggle già nella posizione adatta a disegnare la V seguente.
Your turn. Your code should not be longer than 4 lines (not counting
makeV
)...