The Adventure of the Dancing Men

"The Adventure of the Dancing Men" is a Sherlock Holmes story written by Sir Arthur Conan Doyle as one of 13 stories in the cycle published as The Return of Sherlock Holmes in 1905. It was first published in The Strand Magazine in the United Kingdom in December 1903, and in Collier's in the United States on 5 December 1903.
Conan Doyle ranked "The Adventure of the Dancing Men" third in his list of his twelve favourite Holmes stories. This is one of only two Sherlock Holmes short stories where Holmes' client dies after seeking his help. Holmes's solution to the riddle of the dancing men rests on reasoning that closely resembles that of Legrand in Poe's "The Gold Bug."
The original title was "The Dancing Men," when it was published as a short story in The Strand Magazine in December 1903.
The story begins when Hilton Cubitt of Ridling Thorpe Manor in Norfolk visits Sherlock Holmes and gives him a piece of paper with the following mysterious sequence of stick figures.
Cubitt explains to Holmes and Dr. Watson that he has recently married an American woman named Elsie Patrick. Before the wedding, she had asked her husband-to-be never to ask about her past, as she had had some "very disagreeable associations" in her life, although she said that there was nothing that she was personally ashamed of. Their marriage had been a happy one until the messages began to arrive, first mailed from the United States and then appearing in the garden.
The messages had made Elsie very afraid but she did not explain the reasons for her fear, and Cubitt insisted on honouring his promise not to ask about Elsie's life in the United States. Holmes examines all of the occurrences of the dancing figures, and they provide him with an important clue—he realises that they form a substitution cipher and cracks the code by frequency analysis. The last of the messages causes Holmes to fear that the Cubitts are in immediate danger.
Holmes rushes to Riding Thorpe Manor and finds Cubitt dead of a bullet to the heart and his wife gravely wounded from a gunshot to the head. Inspector Martin of the Norfolk Constabulary believes that it is a murder-suicide attempt; Elsie is the prime suspect. But Holmes, after noting some inconsistencies in that theory, proves that there is a third person involved.
Holmes writes a message—in dancing figure characters—and has it delivered to a lodger named Abe Slaney, another American at a nearby farm. While waiting for the result of this message, Holmes explains to Watson and Inspector Martin how he cracked the code of the dancing figures. In his explanation, Holmes discusses what happened after he cracked the third message. He telegrammed a friend in the New York Police named Wilson Hargreave asking about Slaney, whose name was in the first message, and Hargreave replied to tell Holmes that Slaney was a deadly criminal from Chicago.
The last message, which caused Holmes and Watson to rush to Norfolk, read "ELSIE PREPARE TO MEET THY GOD".
Slaney, unaware that Elsie is gravely wounded, arrives at Ridling Thorpe Manor and is seized as he comes through the door. Holmes had sent for Slaney using the dancing men, knowing that Slaney would believe the message is from Elsie. Slaney reveals that he had been engaged to Elsie, the daughter of the Chicago crime boss whom Slaney works for, and that she had fled to escape her old life. Slaney had come to England to get her back. When Slaney and Elsie were speaking through a window, Cubitt had appeared and shots were exchanged; Cubitt was killed and Slaney had fled. Apparently, Elsie then shot herself. Slaney is arrested and sentenced to hang, but his sentence is reduced to penal servitude because Cubitt had fired the first shot. Elsie recovers from her injuries, and spends her life helping the poor and administering her late husband's estate.
The story was published in the UK in The Strand Magazine in December 1903, and in the US in Collier's on 5 December 1903. It was published with seven illustrations by Sidney Paget in the Strand, and with six illustrations by Frederic Dorr Steele in Collier's. It was included in the short story collection The Return of Sherlock Holmes, which was published in the US in February 1905 and in the UK in March 1905.
The mysterious sequence of stick men is a simple substitution cipher; that is, each stick man represents a given letter of the alphabet.
The above-mentioned fifth and final message that decodes as "ELSIE PREPARE TO MEET THY GOD" looks like this:
Note how the first stick man repeats in the 5th, 8th, and 12th position: it represents the "e" twice present in the words "Elsie" and "prepare". The first and second time the stick man carries a flag – this denotes the end of a word – both words end with an "e".
The Hong Kong children's book series The Great Detective Sherlock Holmes has a version of this story, titled "The Dancing Code" (解碼緝兇). It is book #45 in the original Chinese language series, and in the English translation, done by Maria Kan, it is book #16. The story is set in Hong Kong, and Elsie, renamed Elsie Lee, is Chinese American in this version.