The Pirate Code was a set of laws enacted by pirates to protect their illegal activities and ensure that pirates could continue to earn money. The code usually contained some rules such as pirates could dock at specific locations, trade goods, accept gifts, and so on. These rules are often considered immoral and illegal because they encourage pirates to engage in illegal activities and harm the safety of other ships and navigation. The content of the pirate code varied from time to time and from place to place, but it usually included some provisions related to pirate activities, such as provisions to protect pirates from punishment, the rights and obligations of pirates, how to manage ships and crew, and so on. In some areas, pirates even set their own moral standards and codes of conduct to regulate their behavior.