A mechanical marvel may have helped set Edgar Allan Poe on his life’s creative path.

At the beginning of the 1770s, Wolfgang von Kempelen, a European inventor, premiered his newest creation: a robotic chess player. “Known initially as the Automaton Chess Player and later as the Mechanical Turk—or just the Turk—the machine consisted of a mechanical man dressed in robes and a turban who sat at a wooden cabinet that was overlaid with a chessboard,” writes Ella Morton for Mental Floss. “The Turk was designed to play chess against any opponent game enough to challenge him.” It toured Europe, beating the likes of Benjamin Franklin. Eventually, it was sold to Johann Maelzel, who took the Turk on its biggest adventure yet.

When the Mechanical Turk came to America in April 1826, writes historian Stephen P. Rice, over a hundred people gathered to see its New York debut, and thousands read rave reviews in the newspapers the next day.

“Nothing of a similar nature has ever been seen in this city, that will bear the smallest comparison with it,” wrote the New York Evening Post. Naturally, people were curious how the new man-made wonder worked, Rice writes, leading to further press as Maelzel took the Turk on a tour of the United States.

But it wasn’t just the novelty of a chess-playing robot that kept the conversation going. People were extra-interested in the Turk, he writes, because the fast mechanization of the industrial age had everybody questioning what kinds of work machines could do and just how many human functions they could replace.

Most people, though, thought that Maelzel’s chess player was a fake—not a thinking machine at all, but a simple automaton controlled by a human. The puzzle was how it was controlled–which is where a young Edgar Allan Poe comes in.

“Many writers found inspiration in the Turk,” writes Lincoln Michel for The Paris Review. Poe was chief among them, publishing the essay “Maelzel’s Chess Player” in 1836 in an attempt to debunk the hoax.

If the Turk was a “pure machine,” Poe wrote, it would always win, every time. In total, he offered seven criteria reasoning why the Turk had to be a hoax–a model that bears parallels to Poe's fictional detective C. Auguste Dupin’s method of “ratiocination.”

After due consideration, Poe believed that a small man actually crawled into the body of the Turk and operated it from within. Although the author was right in identifying the hoax, he was wrong about how it was done. The truth was a human sat inside the cabinet. The Museum of Hoaxes writes:

A series of sliding panels and a rolling chair allowed the automaton's operator to hide while the interior of the machine was being displayed. The operator then controlled the Turk by means of a 'pantograph' device that synchronized his arm movements with those of the wooden Turk. Magnetic chess pieces allowed him to know what pieces were being moved on the board above his head.

Maelzel and the Turk’s original owner tended to employ chess champions to work the machine, the museum writes, explaining why it won so often.

After seeing the Turk, Mechel writes, Poe went on to write the first detective stories. But he also conducted “hoaxes of his own, most famously the Balloon-Hoax of 1844, in which he wrote a series of fictionalized newspaper articles about a three-day trans-Atlantic balloon flight.”

Ideas come from the strangest places.