I'd love to know exactly what you mean
Break down the job into steps that can be defined & implemented as functions.
Say for the paint program we briefly threw in as a competition target:
* Draw() - needs to cope with a colour & brush shape
leads on to:
* DrawLine() - needs to accept start & end coordinates as well as a colour & brush.
* Eraser() - trivial, but needs to accept a diameter & shape to erase, as well as dealing with continuous strokes
Leading eventually to:
* Undo() - How do you implement? How many levels? Are we restricting to the foreground channel used by the drawing routines implemented earlier?
You should have the idea by now.
Once written the functions become "stand alone" as part of a potential B4P library of code (say for a graph program), as well as teaching some programming techniques & habits. There may even be some optimisation hints too.