The Goat Puzzle (also known as The Infamous Goat Puzzle, The Infamous Goat, The Wretched Goat, The Goat of Lochmarne, or simply The Goat) is a puzzle featured in Revolution Software's 1996 point and click adventure game Broken Sword: The Shadow of the Templars. In the puzzle, protagonist George Stobbart must gain access to an underground dig located in a castle in Lochmarne, Ireland, while avoiding a fierce goat. The puzzle's perceived difficulty is due to it requiring the player to think in a different way to their approach to previous puzzles in the game. Many gamers and critics consider it to be one of the hardest video game puzzles of all time.
 The puzzle was simplified in The Shadow of the Templars' 2009 director's cut.
 While investigating a murder, protagonist and player character George Stobbart finds himself uncovering a dark mystery regarding the Knights Templar. A medieval manuscript which he obtained during the investigation leads him to a castle located in Lochmarne, Ireland. As he cannot enter the castle through the main entrance door, he climbs a haystack, which stops short of the top of the wall. He puts a sewer key which he obtained at the beginning of the game in a crack in the wall, which forms a step, allowing him to climb over the wall.
 Inside the castle, an entrance to an underground dig is located. A tied-up goat is sitting near the entrance; however, the rope to which it is tied is long enough to allow it to prevent George from reaching the entrance by butting him. An old piece of farming machinery is located at the left side of the screen, but George is unable to interact with it, as the goat continues to butt him.
 George must allow the goat to butt him when trying to reach the entrance, but while the goat is returning to its original position, the player must click on the farming machinery, which causes George to quickly jump up and run to the machinery and slightly reposition it. When returned to its original position, the goat again charges and butts George, but while doing so, gets its rope entangled with the machinery, due to its repositioning. This allows George to move freely and enter the dig.
 The puzzle is considered by many gamers and publications to be one of the most challenging and hardest video game puzzles of all time. Broken Sword creator and Revolution CEO Charles Cecil and Broken Sword designer Steve Ince, as well as publications which have covered it, explain that the puzzle was challenging because the player was not met with any "time critical" puzzle prior to this point in the game, which would mean they "would not necessarily make the connection that clicking on the machinery at a key moment would make this happen." The puzzle was modified to be simpler in the Game Boy Advance release of Broken Sword due to feedback received from players
 Chris Scullion of Official Nintendo Magazine said that "if you've played [Broken Sword], the words 'the goat puzzle' will probably make you break out in a cold sweat." Geoff Thew of Hardcore Gamer wrote that Broken Sword was known for "intricate, challenging puzzles (some infamously so)." The puzzle appeared on Computer and Video Games' 2011 feature, "Gaming's hardest puzzles". In 2012, it was listed on GameFront's "5 Crazy Difficult and Intricate Video Game Puzzles". During a classic postmortem for The Shadow of the Templars at the European Game Developers Conference in August 2014, when Cecil brought up the topic of difficult puzzles, a member of the audience shouted "That fucking goat!"; laughter ensued, and Cecil added: "It was very unfair, and it was absolutely bewildering." He has also claimed he knew he had "made it" when a taxi driver once questioned him about his occupation: upon finding out he had written Broken Sword the driver exclaimed, "Are you the bastard that wrote that goat puzzle?"
 The puzzle was simplified in The Shadow of the Templars' 2009 director's cut by, according to Cecil, adding a more logical solution. This version of the game includes a diary, in which the character takes notes; After completing the goat puzzle, George's diary reads: "So the 'ghost of Lochmarne' is no more than a fierce Billy goat. For a moment I thought it was going to be incredibly awkward to get past, but in the end it was surprisingly simple. Who would have known?", as a reference to the original puzzle's reputation. An easter egg involving a talking goat was included in The Shadow of the Templars' sequel, Broken Sword II: The Smoking Mirror (1997). A goat puzzle was featured in Broken Sword 5: The Serpent's Curse, in the beginning and ending of 2014 second and final episode of the title, as part of the achieved $800,000 Kickstarter "stretch goal".