wildfire/genForet.py
2019-02-02 15:33:54 +01:00

17 lines
No EOL
398 B
Python

# -*- coding: utf-8 -*-
"""
Created on Fri Feb 1 11:30:02 2019
@author: LordOf20th
"""
import numpy as np
import random
import matplotlib.pyplot as plt
def genForet(n):
foret=np.full(shape=(n,n), fill_value=0)
for i in range(0,foret.shape[0]):
for j in range(0,foret.shape[1]):
if random.random() < 0.12:
foret[i,j]=1
return foret