The name of this old game which was a brain teaser is the Incredible Machine from Sierra.