The king composed a new invention in a cave. .