*Make a program that plots random topology map that looks like this.
*Must be in Python!!
here are the instructions
Why is random number generation useful in computer science? Consider our homebrew " \( x+ \) " algorithm. The corners of a map are given random values. Then, the points at their " \( x \) "-intersection are given an altitude which is the average of the surrounding 4 altitudes. The 4 sides (representing the 4 ends of the \( + \) symbol) are given the values associated with the 3 neighboring altitudes. Because values (whether they be integers or floats) actually represent altitudes. When printing the map, high values will have different color than those of low values, giving a neat visualization of the topology. This procedure continues recursively, creating realistic looking terrain.
Requirements Have the map be saved as a matrix (2D array). You are only required to have at least a \( 33 \times 33 \) matrix. You may have your matrix be larger, but not smaller that that. Iterate or recur through the matrix update the values accordingly. Then, draw the map to the screen. The color shown on the screen is based on the altitude. That is, lower values correspond to things like water (blue) and beaches (yellow), while higher values correspond to grass (green) and snow (white). You are required to have at least 4 partitions (with differing colors and symbols) based on altitude: i.e. water, beach, grass, snow. You will only get full points if your program is constructed recursively. The following caveats best describe the recursive method.
Caveats and Tips - Understand the algorithm, perfectly. - Design little by little! - Create a map to use as a global variable. - First, have Python display the map with the 4 corners filled with random values. - Second, have them fill the center node with the average of the 4 corners (+ a random value) - Third, have them fill the sideways nodes with the average of the neighboring nodes ( \( + \) a random value) - Fourth, recall the function and begin again at "First..." with a new set of 4 corners. - It is highly recommended, until you your algorithm mostly working, to add a "sleep" delay at the end of every loop/recursive call to your function. This will help in visualizing what could be wrong with your algorithm. - While testing, after importing the random module, set a seed. This will cause the random number generation to always be the same and let you see small changes to your land better.