Medieval castles had many different parts. Most castles had walls with buttresses that provided additional support against seige engines and catapults. Many castles had moats and drawbridges. Inside the castle itself, the walls and ceilings had murder holes, slots from which objects could be hurled at attackers. Dungeons and oubliettes were also parts of most castles. Within the walls stood a donjon or keep, a standalone structure that could be defended when attackers broke through to the courtyard.
Moats surrounded castles for defensive purposes. Moats were usually filled with water but could be filled with wooden stakes to create a barrier for men and horses. In addition, they prevented enemy sappers from undermining a castle. The main way across a moat is the drawbridge, which is is a movable wooden bridge in front of the main gate of the castle. In some castles, it was moved horizontal to the ground; in others, it was built so it could raise up.
The portcullis is a metal or wood grate that was dropped vertically inside the main gate to prevent attackers from entering. The courtyard was the area inside of the walls. A battlement was a rampart built around the top of a castle with regular gaps for firing arrows. The parts of the battlement were called the crenels, which were wide gaps, and the merlons, which were the solid portion between two crenels.
Battlements were designed so that archers could fire inside the courtyard in the event that attackers broke through the walls.