sparrow asked: I know how to do it using graphics, but I would prefer to use code.