Mesopotamia developed one of the earliest known legal codes, the Code of Hammurabi. Ancient Egypt was one of the oldest civilizations ruled by powerful pharaohs. In ancient India, Hinduism and Buddhism developed, with Hinduism believing in reincarnation and karma and Buddhism started by Siddhartha Gautama. Ancient China was divided into dynasties that were ruled by families, and Confucianism emphasized moral behavior. In ancient Greece, city-states like Athens and Sparta ruled parts of Greece, with Athens being a great sea power and Sparta very militaristic.