Add files via upload

This commit is contained in:
LordOf20th 2019-02-02 15:33:54 +01:00 committed by GitHub
parent aed88b0532
commit 8387dfe65d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

17
genForet.py Normal file
View file

@ -0,0 +1,17 @@
# -*- 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