Wednesday, March 18, 2020
Programming a Tic Tac Toe Game in Visual Basic
Programming a Tic Tac Toe Game in Visual Basic Programming computer games may be the most technically challenging (and possibly the best paying) job that a programmer can have. Top level games require the best from both programmers and computers. Visual Basic 6 has now been thoroughly bypassed as a platform for game programming. (It never really was one. Even in the good ol days, serious game programmers would never use a high-level language like VB 6 because you just couldnt get the cutting edge performance that most games require.) But the simple Tic Tac Toe game is a great introduction to programming that is a little more advanced than Hello World! This is a great introduction to many of the fundamental concepts of programming since it combines techniques including: The use of arrays. The X and O markers are kept in separate arrays and the entire arrays are passed between functions to keep track of the progress of the game.Using VB 6 level graphics: VB 6 doesnt offer great graphical capability, but the game is a good introduction to what is available. Much of the rest of this series is an exploration of how GDI, the next generation of Microsoft graphics, replaces the VB 6 level graphics.Using math calculations for program control: The program uses clever modulo (Mod) and integer division calculations using the two-game marker arrays to determine when a three-element win has occurred. The class of programming in this article is perhaps just a little past the beginning level but it should be good for intermediate programmers. But lets start at an elementary level to illustrate some of the concepts and get you started with your Visual Basic game programming career. Even students more advanced than that may find that its slightly challenging to get the objects in the form just right. How to Play Tic Tac Toe If youve never played Tic Tac Toe, here are the rules. Two players alternate at placing Xs and Os into 3 x 3 playing field. Before the game starts, both players have to agree about who will go first and who will mark his moves with which symbol. After the first move, the players alternately place their marks in any empty cell. The goal of the game is to be the first player with three marks in a horizontal, diagonal or vertical line. If there are no empty cells and neither player has a winning combination, the game is a draw. Starting the Program Before starting any actual coding, its always a good idea to change the names of any components you use. Once you start coding, the name will be used automatically by Visual Basic so you want it to be the right name. Well use the form name frmTicTacToe and well also change the caption to About Tic Tac Toe. With the form established, use the line toolbox control to draw a 3 x 3 grid. Click the line tool, then draw a line where you want it. Youll have to create four lines this way and adjust their length and position to make them look right. Visual Basic also has some convenient tools under the Format menu that will help. This is a great chance to practice with them. In addition to the playing grid, well need some objects for the X and O symbols that will be placed on the grid. Since there are nine spaces in the grid, well create an object array with nine spaces, called elements in Visual Basic. There are several ways to do just about everything in the Visual Basic development environment, and creating control arrays is is no exception. Probably the easiest way is to create the first label (click and draw just like the line tool), name it, set all of the attributes (such as Font and ForeColor), and then make copies of it. VB 6 will ask if you want to create a control array. Use the name lblPlayGround for the first label. To create the other eight elements of the grid, select the first label object, set the Index property to zero, and press CTRLC (copy). Now you can press CTRLV (paste) to create another label object. When you copy objects like this, each copy will inherit all properties except Index from the first one. Index will increase by one for each copy. This is a control array because they all have the same name, but different index values. If you create the array this way, all of the copies will be stacked on top of each other in the upper left corner of the form. Drag each label to one of the playing grid positions. Be sure that index values are sequential in the grid. The logic of the program depends on it. The label object with index value 0 should be in the top left corner, and the bottom right label should have index 8. If the labels cover the playing grid, select each label, right-click, and select Send to Back. Since there are eight possible ways to win the game, well need eight different lines to show the win on the playing grid. You will use the same technique to create another control array. First, draw the line, name it linWin, and set the Index property to zero. Then use copy-paste technique to produce seven more lines. The following illustration shows how to set the index numbers correctly. In addition to the label and line objects, you need some command buttons to play the game and more labels to keep score. The steps to create these are not detailed here, but these are the objects you need. Two button objects: cmdNewGamecmdResetScore Frame object fraPlayFirst containing two option buttons: optXPlayeroptOPlayer Frame object fraScoreBoard containing six labels. Only lblXScore and lblOScore are changed in the program code. lblXlblXScorelblOlblOScorelblMinuslblColon Finally, you also need the label object lblStartMsg to mask the cmdNewGame button when it shouldnt be clicked. This isnt visible in the illustration below because it occupies the same space in the form as the command button. You may have to move the command button temporarily to draw this label on the form. So far, no VB coding has been done, but were finally ready to do that. Initialization Now you get to finally start coding the program. If you havent already, you might want to download the source code to follow along as the operation of the program is explained. One of the first design decisions to make is how to keep track of the current state of the game. In other words, what are the current Xs and Os on the playing grid and who moves next. The concept of state is critical in a lot of programming, and in particular, its important in programming ASP and ASP.NET for the web There are several ways that this could be done, so its a critical step in the analysis. If you were solving this problem on your own, you might want to draw a flowchart and try out different options with scratch paper before starting any coding. Variables Our solution uses two two-dimensional arrays because that helps keep track of state by simply changing the array indexes in program loops. The state of the top-left corner will be in the array element with index (1, 1), the top-right corner will be in (1, 3), the bottom-right in (3,3), and so forth. The two arrays that do this are: iXPos(x, y) and iOPos(x, y) There are a lot of different ways this can be done and the final VB.NET solution in this series shows you how to do it with just a single one-dimensional array. The programming to translate these arrays into player win decisions and visible displays in the form are on the next page. You also need a few global variables as follows. Notice that these are in the General and Declarations code for the form. This makes them module level variables that can be referenced anywhere in the code for this form. For more on this, check Understanding the Scope of Variables in Visual Basic Help. There are two areas where variables are initialized in our program. First, a few variables are initialized while the form frmTicTacToe is loading. Private Sub Form_Load() Second, before each new game, all variables that need to be reset to starting values are assigned in an initialization subroutine. Sub InitPlayGround() Note that the form load initialization also calls the playground initialization. One of the critical skills of a programmer is the ability to use the debugging facilities to understand what the code is doing. You can use this program to try: Stepping through the code with the F8 keySetting a watch on key variables, such as sPlaySign or iMoveSetting a breakpoint and querying the value of variables. For example, in the inner loop of the initialization: lblPlayGround((i - 1) * 3 j - 1).Caption Note that this program clearly shows why its a good programming practice to keep data in arrays whenever possible. If you did not have arrays in this program, you would have to write code something like this: Line0.Visible FalseLine1.Visible FalseLine2.Visible FalseLine3.Visible FalseLine4.Visible FalseLine5.Visible FalseLine6.Visible FalseLine7.Visible False instead of this: For i 0 To 7linWin(i).Visible FalseNext i Making a Move If any part of the system can be thought of as the heart, its subroutine lblPlayGround_Click. This subroutine is called every time a player clicks the playing grid. (Clicks must be inside one of the nine lblPlayGround elements.) Notice that this subroutine has an argument: (Index As Integer). Most of the other event subroutines, like cmdNewGame_Click() do not. Index indicates which label object has been clicked. For example, index would contain the value zero for the top-left corner of the grid and the value eight for the bottom-right corner. After a player clicks a square in the game grid, the command button to start another game, cmdNewGame, is turned on by making it visible. The state of this command button does double duty because its also used as a boolean decision variable later in the program. Using a property value as a decision variable is usually discouraged because if it ever becomes necessary to change the program (say, for example, to make the cmdNewGame command button visible all the time), then the program will unexpectedly fail because you might not remember that its also used as part of the program logic. For this reason, its always a good idea to search through program code and check the use of anything you change when doing program maintenance, even property values. This program violates the rule partly to make this point and partly because this is a relatively simple piece of code where its easier to see what is being done and avoid problems later. A player selection of a game square is processed by calling the GamePlay subroutine with Index as the argument. Processing the Move First, you check to see if an unoccupied square was clicked. If lblPlayGround(xo_Move).Caption Then Once were sure this is a legitimate move, the move counter (iMove) is incremented. The next two lines are very interesting since they translate the coordinates from the one-dimensional If lblPlayGround component array to two-dimensional indexes that you can use in either iXPos or iOPos. Mod and integer division (the backslash) are mathematical operations that you dont use every day, but heres a great example showing how they can be very useful. Ã If lblPlayGround(xo_Move).Caption TheniMove iMove 1x Int(xo_Move / 3) 1y (xo_Move Mod 3) 1 The xo_Move value 0 will be translated to (1, 1), 1 to (1, 2) ... 3 to (2, 1) ... 8 to (3, 3). The value in sPlaySign, a variable with module scope, keeps track of which player made the move. Once the move arrays are updated, the label components in the playing grid can be updated with the appropriate sign. If sPlaySign O TheniOPos(x, y) 1iWin CheckWin(iOPos())ElseiXPos(x, y) 1iWin CheckWin(iXPos())End IflblPlayGround(xo_Move).Caption sPlaySign For example, when the X player clicks the top left corner of the grid, variables will have the following values: The user screen shows only an X in the upper left box, while the iXPos has a 1 in the upper left box and 0 in all of the others. The iOPos has 0 in every box. The values changes when the O player clicks the center square of the grid. Now th iOPos shows a 1 in the center box while the user screen shows an X in the upper left and an O in the center box. The iXPos shows only the 1 in the upper left corner, with 0 in all of the other boxes. Now that you know where a player clicked, and which player did the clicking (using the value in sPlaySign), all you have to do is find out if someone won a game and figure out how to show that in the display. Finding a Winner After each move, the CheckWin function checks for the winning combination. CheckWin works by adding down each row, across each column and through each diagonal. Tracing the steps through CheckWin using Visual Basics Debug feature can be very educational. Finding a win is a matter of first, checking whether three 1s were found in each of the individual checks in the variable iScore, and then returning a unique signature value in Checkwin that is used as the array index to change the Visible property of one element in the linWin component array. If there is no winner, CheckWin will contain the value -1. If there is a winner, the display is updated, the scoreboard is changed, a congratulation message is displayed, and the game is restarted. Lets go through one of the checks in detail to see how it works. The others are similar. Check Rows for 3For i 1 To 3iScore 0CheckWin CheckWin 1For j 1 To 3iScore iScore iPos(i, j)Next jIf iScore 3 ThenExit FunctionEnd IfNext i The first thing to notice is that the first index counter i counts down the rows while the second j counts across the columns. The outer loop, then simply moves from one row to the next. The inner loop counts the 1s in the current row. If there are three, then you have a winner. Notice that you also keep track of the total number of squares tested in the variable CheckWin, which is the value passed back when this function terminates. Each winning combination will end up with a unique value in CheckWin from 0 to 7 which is used to select one of the elements in the linWin() component array. This makes the order of the code in function CheckWin important too! If you moved one of the blocks of loop code (like the one above), the wrong line would be drawn on the playing grid when someone wins. Try it and see! Finishing Details The only code not yet discussed is the subroutine for a new game and the subroutine that will reset the score. The rest of the logic in the system makes creating these quite easy. To start a new game, you have only to call the InitPlayGround subroutine. As a convenience for players since the button could be clicked in the middle of a game, you ask for confirmation before going ahead. You also ask for confirmation before restarting the scoreboard.
Monday, March 2, 2020
How to get better at taking risks
How to get better at taking risks Risk is scary. Everything in human history has evolved to make us scared of risk. After all, time has taught us that risks can get you eaten by animals in the wild, or have you holding your head in despair while the stock market (with your bold investment in ostrich futures) tanks. But risk can also be rewarding when it comes to your career. If you feel like you could use a little more bravery, there are ways to rewire your thinking to make yourself more open to risk. Nothing too bold or daredevil-y (for now), though- weââ¬â¢ll leave that to Richard Branson.Set your goals.The most effective risk-taking is tied to specific goals. Youââ¬â¢re not doing something just for the sake of doing it, but rather to learn something, or overcome a particular issue, or advance to a milestone. If you want to start embracing more risks in order to improve your job status or your pay grade, it starts with clearly defining your career goals. If it means starting your own business, or going freela nce after being a full-time corporate worker, itââ¬â¢s important to keep in mind that your ultimate goal is independence. As long as you have that goal in your head as the end result, it can make big jumps (like quitting your day job) easier to do.Do your research.Data makes you feel better. If youââ¬â¢re thinking about switching jobs or changing careers altogether, the best thing you can do to validate the risk is gather as much information as you can. If youââ¬â¢re thinking about making a significant investment and going back to school, what are the job stats for new graduates in your field? If youââ¬â¢re thinking about asking for a raise, what are people at your level in your field making? It can also help you make an informed decision to walk away from the risk, too- itââ¬â¢s not just about talking yourself into doing something, but about understanding what youââ¬â¢re about to do.Start small.Even with your big goals in mind, set smaller milestones (and therefor e smaller risks) to check off along the way. That way, youââ¬â¢re not going all-in on something that feels big and scary because youââ¬â¢ve already made progress and smaller commitments toward that goal. For example, if youââ¬â¢re thinking of starting your own business, begin by opening a business bank account or getting the paperwork started for an LLC. Those are significant steps, but not so frightening in and of themselves.Donââ¬â¢t worry about being perfect.If youââ¬â¢re taking a risk, you might think everything has to align perfectly for it to be successful. Not so! Taking action is the truly important part. Hesitation over results can stop recovering perfectionists and overachievers in their steps. In the worst case scenario, youââ¬â¢ll fail- but at least youââ¬â¢ll have tried and learned valuable lessons about what works and what doesnââ¬â¢t.Risks donââ¬â¢t have to be grand gestures that change everything forever. A risk can be something as simple a s doing something out of your comfort zone. As long as you have a purpose and a plan behind you, youââ¬â¢ll find that taking risks isnââ¬â¢t so scary after all- and realize itââ¬â¢s something we can all learn to do smarter.
Saturday, February 15, 2020
The Israelis Essay Example | Topics and Well Written Essays - 500 words
The Israelis - Essay Example The contradiction in Israel is, the ordinary Jewish citizens are a preferred lot over their Arab compatriots. Along with the rigid religious establishment, a thriving lesbian and gay community exists. In this book, Donna Rosenthal, has taken pains to interview a heterogeneous section of the people-- Jewish, Arab, men and women, secular and religious, with their fears and hopes, enthusiasm and disillusionment, willing acceptance of challenges and also expressing defianceâ⬠¦how Israel makes efforts to transform itself into an ultra-modern state, to stand shoulder to shoulder and challenge the world powers, to tellââ¬ânot we also countââ¬âbut better take us into account! Nation building from the scratch is not an ordinary process. Striking a balance between the orthodox and ultra-modern of the same religious group is all the more difficult. Interaction between the two has to happen often. Rosenthal writes about the strange meetings thus: ââ¬Å"An electrical engineer with a long ponytail is eating pasta with a bearded orthodox man in a knit kippa. At the salad bar, two women programmers chat in Russian.â⬠(p.126) Immodestly dressed women in Jerusalem streets are abused by the orthodox. Rosenthal writes, ââ¬Å"Some men wear their short, others dangle them below their ears. Signs in their haredi neighborhood warn women to dress modestly, not to expose much skin. Blouses cover them from collarbone to wrists.â⬠(p.174) In the matter of worship the male-female division is enforced strictly. ââ¬Å"In haredi and orthodox synagogues, men and women sit apart so they will not be distracted from prayers. In haredi synagogues, women sit in balconies o r behind curtains.â⬠(p.182) In the same city, you have modern entrepreneurs engaged in research for high-tech industrial products. Children of Bedouin families and Israeli Arabââ¬âboth have problems in establishing their identities in a Jewish
Sunday, February 2, 2020
How specific groups are represented in scripted television shows Essay
How specific groups are represented in scripted television shows - Essay Example It is important for such representation to adopt strategies that would help in the dismantling of misrepresentations, which have always been propagated with regard to some specific groups. Such specific groups could include gay groups, African Americans, women, immigrants, and others, which have attracted conflicting perspectives in the various attempts to access the inner patterns and rhythms of their world view. One potent illustration is the representation of the African American woman in ââ¬Å"Awkward Black Girlâ⬠by Issa Rac (Christian, 2011). One of the underlying objectives of this show is to provide alternative portrayal of the African American woman. The creator emphasizes on the need to develop a product that would capture the real lives of the African Americans (Christian, 2011). She argues that the subject has been misrepresented in a variety of discourses across time and history. The aspect of creativity is equally important as it helps to instil the proper aesthet ics in the subject as portrayed in a completely new dimension. When properly represented, such strategies help in redeeming the special groups from the injustices of negative or inaccurate representations, which are mainly guided by misconceptions, stereotypes, and untruths as understood within the mentalities of the superior groups. Consistently, many special groups have lost favour in the cable television networks and must find alternative forms of media in order to reach their target audiences. Web series have become one of readily available and most resourceful solutions to such groups (Christian, 2010). However, this alternative features multiple opportunities and challenges. Web is slow and compares poorly to cable networks. As an alternative to cable television, web does not attract large audiences and does not have a determinate and visible physical presence on the market. By its very nature, it is fluid and variable, which denies it the advantage of stability and popularity . These same qualities also lock it out from lucrative segments of the market such as older audiences who are less likely to consume web-based products. Such audiences are conservative in nature are more likely to stick with the tried and tested methods (Siapera, 2010). Statistics from comparative analyses between web series and cable television show that the consumption of web series products is likely to correspond with the patterns of internet use. Past studies on internet usage have shown significant variations in the patterns and trends of internet consumption across the variables of gender, race, social status, levels of income, and other demographics that are to be found within the American population (Fourie, 2010; Hammer & Keller, 2009). Web has not built stable and reliable clientele that would shore up the ratings and performance of the upstart networks. Some media scholars have explained it as being at an evolutionary stage and that it may take some time for it to be emb raced wholly by larger segments of the society. Web is still a new invention in the media world and has not built reliable metrics that would help to even the odds faced by minority shows (Christian, 2010). Even then, web series remains some of the most convenient escapes onto the wider market by programs and shows run by minorities and which have been affected by structural and systematic challenges of survival. Studies have also shown that the web-based media
Saturday, January 25, 2020
Neurobiology of Harmony :: Biology Essays Research Papers
Neurobiology of Harmony How sound waves produced by instruments become sensible representations in the brain, and how the perceptions become meaningful are interesting questions for neurobiology to ask, as well as necessary ones if knowledge of the brain is to account for all behavior. The brain is able to discern harmony because the inner ear is capable of differentiating between different frequencies. The brain's differentiation between pitches and chords corresponds to the physical, "real," differences between notes and chords, although our sense of music built from perception of harmonies through time, is more subjective and variable. Our faculty of hearing derives from the anatomy of the inner ear and the brain, as well as from the existence of external stimuli in the outside world. Sound is both the mechanical energy of waves and the sensation produced by receptors in the brain (1). Each wave has an amplitude and a frequency. The amplitude of a vibration corresponds to its volume and is measured by decibels on a logarithmic scale. Frequency is logarithmic, as well, but corresponds to differences in pitch. Greater frequency results in a higher pitch. Mathematically, pitch is represented as the number of vibrations per second (1) (2) . Vertebrates hear sound through their neurobiological makeup. The ear's tympanic membrane, or eardrum, vibrates as a result of being subjected to sound waves. The waves then travel to the inner ear or cochlea which is the site of sound's transduction into chemical energy. Within the cochlea, sound waves travel through fluid which stimulates the stereocilia, small hair-like projections of hair cells along the basilar membrane. The actions of the stereocilia cause the release of K+, potentially depolarizing the cell (1). The flexibility of the basilar membrane allows stereocilia to move back and forth in response to the waves in the Cochlear fluid. Each stereocilium is linked to another through structures called "tip links" (1) , (3) As the stereocilia move towards the tallest ones, the tip links cause ion channels to open, depolarizing the cell and allowing free K+ to move into the cell (1). Importantly, the stereocilia move in direct response to the sound waves and are cumulative rath er than spiking. Neurotransmitter release corresponds to the frequency and amplitude (pitch and volume) of a sound input. Sounds must be sufficiently loud and within a given range in order to cause action potentials. Different sounds will produce different outputs, allowing for discrimination of harmony on a neural level (1).
Thursday, January 16, 2020
Tqm (Total Quality Management)
TOTAL QUALITY MANAGEMENT Total Quality Management formally known as total quality control emphasizes the crucial role of management in the quality process and utilizes a combination of methods, theories, techniques, and quality guru strategies for achieving world-class quality. TQM is not a complete solution formula as viewed by many but a lasting commitment to the process of continuous improvement. Total quality management is not a fad of the times, but rather a correction of the previous failures in management combined to produce a better management style when used appropriately (http://www. ejs. com, retrieved August 1, 2009). The word ââ¬Å"totalâ⬠in Total Quality Management means that everyone in the organization participates in the overall effort in process improvement. Quality means meeting or exceeding customer (internal or external) expectation and management means improving and maintaining business processes or activities. Communications, cultural transformation, par ticipative management, customer focus and continuous improvement are the five basic elements of TQM. Communication is the exchange of information and understanding between two or more people. There is communication if the information is received and understood. A company will not be successful if it will not listen to employees and to its customers. If there is on fundamental principle of TQM, it is that quality is what the customer defines it as, not what the organization defines it to be. TQM calls for a cultural transformation which requires a high level of workforce engagement wherein people do their utmost for the benefit of their customers and for the success of the organization. Cultural information implies that all employees must change their traditional way of thinking about business. It is a cultural change for everyone to be responsible for quality. For the past years, quality was viewed as a manufacturing problem only, but it has now become a service issue as well. TQM is a philosophy that prevents poor quality in products and services. A company vision that defines and supports quality must be shared by anyone in an organization. TQM also involves Participative Management Style where managers develop genuine partnership with the workforce and they both contribute to achieving quality. This management philosophy is often misused by management as a way of avoiding responsibility. Managers using this philosophy must be leaders, take the initiative, and accept responsibility for giving orders or making decisions. Participative management can be best achieved through empowerment and involvement. Every member of the organization gives their views and suggestions regarding improvements and the combined thoughts and ideas will be evaluated by the empowered associates who have the authority to make decisions and to take actions in their work areas without prior approval while willingly supported by the executives and managers. The pursuit of TQM must emphasize customer focus which is an important factor in an organizational survival or demise. Organizations depend on their customers and therefore should understand current and future customer needs, should meet customer requirements and strive to exceed customer expectations. The last element of TQM is the continuous improvement which should be a permanent objective of the organization in its overall performance. Applying the principle of continual improvement typically leads to employing a consistent organization-wide approach to continual improvement of the organization's performance, providing people with training in the methods and tools of continual improvement, making continual improvement of products, processes and systems an objective for every individual in the organization, establishing goals to guide, and measures to track, continual improvement, and recognizing and acknowledging improvements. Bibliography: A. Books Aquino, G. V. (2005) Fundamentals of research. Mandaluyong City: Cacho Hermanos, Incorporated. Cruz, Myrna. (2007). Statistics and probability theory, Makati City: Cruz Publishing. Evans, J. R. & Dean, J. W. (2000) Total quality management organization and strategy. Australia: Southwestern College Publication.
Wednesday, January 8, 2020
Angkor Wat, Cambodia
The temple complex at Angkor Wat, just outside of Siem Reap, Cambodia, is world famous for its intricate lotus blossom towers, its enigmatic smiling Buddha images and lovely dancing girls (apsaras), and its geometrically perfect moats and reservoirs. An architectural jewel, Angkor Wat itself is the largest religious structure in the world. It is the crowning achievement of the classical Khmer Empire, which once ruled most of Southeast Asia. The Khmer culture and the empire alike were built around a single critical resource: water. Lotus Temple on a Pond: The connection with water is immediately apparent at Angkor today. Angkor Wat (meaning Capital Temple) and the larger Angkor Thom (Capital City) are both surrounded by perfectly square moats. Two five-mile-long rectangular reservoirs glitter nearby, the West Baray and the East Baray. Within the immediate neighborhood, there are also three other major barays and numerous small ones. Some twenty miles to the south of Siem Reap, a seemingly inexhaustible supply of freshwater stretches across 16,000 square kilometers of Cambodia. This is the Tonle Sap, Southeast Asias largest freshwater lake. It may seem odd that a civilization built on the edge of Southeast Asias great lake should need to rely on a complicated irrigation system, but the lake is extremely seasonal. During the monsoon season, the vast amount of water pouring through the watershed causes the Mekong River to actually back up behind its delta, and begin to flow backward. The water flows out over the 16,000 square kilometer lake-bed, remaining for about 4 months. However, once the dry season returns, the lake shrinks down to 2,700 square kilometers, leaving the Angkor Wat area high and dry. The other problem with Tonle Sap, from an Angkorian point of view, is that it is at a lower elevation than the ancient city. Kings and engineers knew better than to site their wonderful buildings too close to the erratic lake/river, but they did not have the technology to make water run uphill. Engineering Marvel: In order to provide a year-round supply of water for irrigating rice crops, the engineers of the Khmer Empire connected a region the size of modern-day New York City with an elaborate system of reservoirs, canals, and dams. Rather than using the water of Tonle Sap, the reservoirs collect monsoon rainwater and store it for the dry months. NASA photographs reveal the traces of these ancient waterworks, hidden at ground level by the thick tropical rainforest. A steady water supply allowed for three or even four plantings of the notoriously thirsty rice crop per year and also left enough water for ritual use. According to Hindu mythology, which the Khmer people absorbed from Indian traders, the gods live on the five-peaked Mount Meru, surrounded by an ocean. To replicate this geography, the Khmer king Suryavarman II designed a five-towered temple surrounded by an enormous moat. Construction on his lovely design began in 1140; the temple later came to be known as Angkor Wat. In keeping with the aquatic nature of the site, each of Angkor Wats five towers is shaped like an unopened lotus blossom. The temple at Tah Prohm alone was served by more than 12,000 courtiers, priests, dancing girls and engineers at its height - to say nothing of the empires great armies, or the legions of farmers who fed all the others. Throughout its history, the Khmer Empire was constantly at battle with the Chams (from southern Vietnam) as well as different Thai peoples. Greater Angkor probably encompassed between 600,000 and 1 million inhabitants - at a time when London had perhaps 30,000 people. All of these soldiers, bureaucrats, and citizens relied upon rice and fish - thus, they relied upon the waterworks. Collapse: The very system that allowed the Khmer to support such a large population may have been their undoing, however. Recent archaeological work shows that as early as the 13th century, the water system was coming under severe strain. A flood evidently destroyed part of the earthworks at West Baray in the mid-1200s; rather than repairing the breach, the Angkorian engineers apparently removed the stone rubble and used it in other projects, idling that section of the irrigation system. A century later, during the early phase of what is known as the Little Ice Age in Europe, Asias monsoons became very unpredictable. According to the rings of long-lived po mu cypress trees, Angkor suffered from two decades-long drought cycles, from 1362 to 1392, and 1415 to 1440. Angkor had already lost control of much of its empire by this time. The extreme drought crippled what remained of the once-glorious Khmer Empire, leaving it vulnerable to repeated attacks and sackings by the Thais. By 1431, the Khmer people had abandoned the urban center at Angkor. Power shifted south, to the area around the present-day capital at Phnom Pehn. Some scholars suggest that the capital was moved to better take advantage of coastal trading opportunities. Perhaps the upkeep on Angkors waterworks was simply too burdensome. In any case, monks continued to worship at the temple of Angkor Wat itself, but the rest of the 100 temples and other buildings of the Angkor complex were abandoned. Gradually, the sites were reclaimed by the forest. Although the Khmer people knew that these marvelous ruins stood there, amidst the jungle trees, the outside world did not know about the temples of Angkor until French explorers began to write about the place in the mid-nineteenth century. Over the past 150 years, scholars and scientists from Cambodia and around the world have worked to restore the Khmer buildings and unravel the mysteries of the Khmer Empire. Their work has revealed that Angkor Wat truly is like a lotus blossom - floating atop a watery realm. Photo Collections from Angkor: Various visitors have recorded Angkor Wat and surrounding sites over the past century. Here are some historic photos of the region. Margaret Hays photos from 1955. National Geographic/Robert Clarks photos from 2009. Ã Sources Angkor and the Khmer Empire, John Audric. (London: Robert Hale, 1972). Angkor and the Khmer Civilization, Michael D. Coe. (New York: Thames and Hudson, 2003). The Civilization of Angkor, Charles Higham. (Berkeley: University of California Press, 2004). Angkor: Why an Ancient Civilization Collapsed, Richard Stone. National Geographic, July 2009, pp. 26-55.
Subscribe to:
Posts (Atom)