generating unintelligent random maps on mouse press

this code generates random maps on mouse press. it is really just a simple 2d array value filling. a modification of this article.

demo

explanations

 

 

here we generated a random map by looping and assigning a random value. randint returns a value betwen 1 and 0. the advantage of a function is that we just need to call it each time a random map is needed

 

 

each time the mouse is pressed, random_map() is called

  •  
  •  
  •  
  •  

Lives in Mauritius, cruising python waters for now.