The Temple of Literature, dedicated to the Chinese Philosopher is one of Hanoi’s oldest structures. If you wish to learn more about the region that has been continuously inhabited for the past 4,000 years and explore the crowded streets of the Vietnamese capital lined with prominent landmarks and, perhaps, discover some cute hidden gems along the way, too, take this self-guided introductory walk. Hanoi also hosts a number of cultural venues, such as the National Museum of Fine Arts. In 2004, a massive part of the 900-year-old Imperial Citadel of Thăng Long - currently a UNESCO World Heritage Site - was discovered near Ba Đình Square. Also here, juxtaposed with French colonial architecture, are a number of prominent imperial sites like the Temple of Literature (1070), the One Pillar Pagoda (1049), and the Flag Tower of Hanoi (1812). The central Ba Đình district holds a high concentration of government headquarters, including the Presidential Palace, and the monumental Ho Chi Minh Mausoleum. Following the end of the Vietnam War (1955–1975) and reunification of North and South Vietnam, Hanoi became the capital of the Socialist Republic of Vietnam, on 2 July 1976. The French reoccupied the city again in 1946, and after years of fighting between them and the Viet Minh forces (First Indochina War, 1946–1954) it had finally become the capital of independent North Vietnam, in 1954. During WWII, from 1940 to 1945, it was occupied by the Imperial Japanese forces and then briefly became the seat of the Việt Minh government after Ho Chi Minh declared the independence of Vietnam. The city served as the capital of French Indochina from 1887 until the mid 1940s. Hanoi is also sometimes dubbed "Paris of the East" for its French-style tree-fringed boulevards, dozens of lakes and thousands of French colonial-era buildings, all of which make it a popular tourist destination. Finally, in 1831, emperor Minh Mạng renamed it Hà Nội (which means "Between the Rivers") which has remained the city's official name ever since. During the Lê dynasty (1428-1789), the city was known as Đông Kinh ("Eastern Capital"), the name which had eventually transformed to Tonkin. In 1010, Vietnamese emperor Lý Thái Tổ established his capital on the territory of present-day downtown, calling it Thăng Long ("Ascending Dragon"). In 866, the town was turned into a citadel named Đại La ("Big Net"). The word long ("dragon") here is associated with the Red River which curves around the city, resembling a dragon. Throughout its history, Hanoi has gone by different names including Long Biên ("Dragon Edge"), Tống Bình ("Song Peace") and Long Đỗ ("Dragon Belly"). Following the collapse of Âu Lạc, the city was made part of Han China (111 BC-40 AD). Originally, a portion of modern-day Hanoi served as the capital of the historic Vietnamese nation Âu Lạc. for its centuries-old architecture and rich culture with Southeast Asian, Chinese and French influences, the capital of Vietnam, Hanoi, traces its origin back to the third century BC. Positions = hanoi(pegs, 0, 2, number_of_pegs) Visually shows the process of optimal solution of an hanoi tower problem. Start_y - peg_height * i, # Pegs are one on top of the other, height depends on iterationĭef visual_hanoi_simulation(number_of_pegs, base_width, peg_height, sleeping_interval): Start_x + (SPACE_PER_PEG - pegwidth)/2, # Handles alignment putting pegs in the middle, like a piramid Like in a piramid, the smaller in lighter color. Given a pile of pegs, displays them on the screen, nicely inpilated > for position in hanoi(,, ], 0, 2, 3): print positionĪssert len(pegs) >= n, 'not enough disks on peg'Īux = 3 - start - target # start + target + aux = 3įor i in hanoi(pegs, start, aux, n-1): yield iįor i in hanoi(pegs, start, target, 1): yield iįor i in hanoi(pegs, aux, target, n-1): yield iĭef display_pile_of_pegs(pegs, start_x, start_y, peg_height, screen): The sequence of optimal steps that leads to the solution. This function, given a starting position of an hanoi tower, yields The code is pretty simple, tested and documented, so no further introduction is needed. The logic of the solving is taken from StackOverflow (see links in docstring), I wrote the part dealing with the graphics, so review is most welcome on the graphical part that I wrote. I wrote a program to show graphically the solution of the problem of the Tower of Hanoi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |