Between the time periods of 600-1450 Common Era, it was
referred to as the dark ages in Europe because the cities and regions in Europe
lack poetry, which was a dark experience. It was not really a dark globally,
but only in the part of Europe wherein poetry vanished, but right after the
dark ages, was the beginning of the modern age, which gave life to poetry and
to music once more.
The main reason for them creating a written code of law was because they had a huge empire and maintaining such an empire required a unified law that could be applied to everyone and every case.
The correct answer in this case would be so that their citizens would be able to see and understand it. This allowed them to familiarize themselves with the law and abide by it if they desired to do so.