Where did Shakepeare get the idea for Hamlet?
From wikipedia: “Hamlet is based on a Danish legend that Saxo Grammaticus recorded in his Gesta Danorum. François de Belleforest translated this legend into French in his Histoires Tragiques (1570). Shakespeare is thought to have borrowed much of his plot from a now-lost Elizabethan play—known today as the Ur-Hamlet—which was the first version of the story known to have a ghost in it. Although Hamlet bears many similarities to Belleforest’s work, it is unknown whether Shakespeare took elements from it directly, or indirectly via the Ur-Hamlet or some other source. Shakespeare wrote his play sometime between 1599 and 1601, with three different versions surviving. Known as the First Quarto (Q1}, Second Quarto (Q2), and First Folio (F1), each has lines—and even scenes—missing from the others. The story of the prince who plots revenge on his uncle (the current king) for killing his father (the former king) is an old one. Many of the story elements—the prince’s feigned madness, his mother’s