Add files via upload
This commit is contained in:
parent
aed88b0532
commit
8387dfe65d
1 changed files with 17 additions and 0 deletions
17
genForet.py
Normal file
17
genForet.py
Normal 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
|
||||||
Loading…
Add table
Reference in a new issue