During the Middle Ages castles were used for wars, defense, and some might call it home. Castles were generally made out of wood, brick or stone. The structure or architecture of the castle was usually built on hills or hilly areas for protection, isolation, and if there was an enemy invading you could see a long distance to sense out danger. Also there was always a most, therefor enemies reaching them would have a harder time. To go along with the moat there was the drawbridge for exiting the castle, providing protection, and to lead the charge against enemy invaders. The ones who protected the castle were the knights who also protected its people from enemies.So defending a castle was harder than it looked. The inside of the castle there was a kitchen, living room a couple bedrooms, a bathroom and a basement were the extra materials were kept and oh yes the dungeon. In the tower there were usually bedrooms or storage rooms. The dungeon was a place in the basement behind bars sorta of like a jail cell where prisoners were kept hostage for invading or they were captured in battle. If the enemies were attacking and made it through the knights they would have another thing coming because the people inside set all sorts of traps like trap doors or the classic catapult.