The history of gambling is full of various myths, legends, facts and conjectures. It originates in ancient Egypt and Italy of the Middle Ages, and ends with the modern era of online games. Previously, gambling played a much greater importance in society than now: for example, the territorial dispute between Sweden and Norway in the 11th century was resolved by throwing bones. In China, thanks to gambling, the army was sponsored, and during the years 1700-1709 the lottery helped feed the British colonies. A few years later, Americans began to use the lottery to finance educational programs.