The city of Jaipur was founded in 1727 by Mughal general and the King of Amer, Jai Singh II who ruled from 1699 to 1743. He planned to shift his capital from Amer, 11 kilometres (7 mi) to Jaipur to accommodate the growing population and increasing scarcity of water. Jai Singh consulted several books on architecture and architects while planning the layout of Jaipur. Under the architectural guidance of Vidyadhar Bhattacharya, Jaipur was planned based on the principles of Vastu Shastra and Shilpa Shastra. The construction of the city began in 1726 and took four years to complete the major roads, offices, and palaces. The city was divided into nine blocks, two of which contained the state buildings and palaces, with the remaining seven allotted to the public. Huge ramparts were built, pierced by seven fortified gates. During the rule of Sawai Ram Singh I, the city was painted pink to welcome HRH Albert Edward, Prince of Wales (who later became King Edward VII, Emperor of India), in 1876. Many of the avenues still remain painted in pink, giving Jaipur a distinctive appearance and the epithet Pink city. In the 19th century, the city grew rapidly and by 1900 it had a population of 160,000. The wide boulevards were paved and its chief industries were the working of metals and marble, fostered by a school of art founded in 1868. The city had three colleges, including a Sanskrit college (1865) and a girls’ school (1867) opened during the reign of the Maharaja Ram Singh II.