Code for a simple drawing machine