Castles

picture from The Castles of Whales
Medieval castles were built mainly for defense. Because of that windows were few and iron grates were laid on top of them. Most were built between 1000 and 1300 ad. They were built in places that would offer the most protection and allow them to control the surrounding area. Generally they were built on hills, bends on rivers or cliffs. The castles had towns near them, so that the towns could be protected and the castles could have provisions.
The first castles were wooden structures built on mounds with ditches dug around them. Later, castles were built with thick outer and inner walls. The walls were built out of stone and varied in thickness and height. They had battlements, walkways, and towers built along the walls. There were thin slits in the walls behind which archers could stand ad shoot through, and not have to worry about being harmed themselves. The towns that were built by the castles were also surrounded by walls.
At each of the gates there was a tower on either side of the opening in the wall. There were iron coated portcullises, heavy wooden doors and often drawbridges in the gate house. Thick wooden boards could be placed in slots to block the doors and arrows, stones, and other things could be shot or dropped through holes in the ceiling. The towers on the inner walls often had rooms used as living quarters, storage rooms, and dungeons. Other living quarters, barracks, dining halls, stables, and other necessities were placed in wooden buildings within the inner walls. The Norman castles had tall, thick-walled keeps which contained places to live, and things needed to sustain the inhabitants of the castle for a long siege. The first keeps were square, but it was soon found out that circular ones were easier to defend so they were used more often.
Over time the crude ditches that surrounded the castles were made deeper and wider. They were meant to be filled with water. Often they were left dry. To allow passage over the moats drawbridges were extended to the other side. In the case of an attack they could be drawn up to prevent the enemies from crossing the moat and to block the doors.
When gun powder and cannons were invented castles were no longer of any use. their walls could easily be broken by the cannons. Now the once magnificent castles are only ruins or used as homes.