Text this: A method of constructing programmed motions of a mechanical system