mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Update game_of_life.py
docstring error fix delete no reason delete next_gen_canvas code(local variable)
This commit is contained in:
parent
c873fa0b1b
commit
a8ff2cbb6e
@ -60,7 +60,7 @@ def run(canvas):
|
|||||||
|
|
||||||
@returns:
|
@returns:
|
||||||
--
|
--
|
||||||
None
|
List
|
||||||
"""
|
"""
|
||||||
canvas = np.array(canvas)
|
canvas = np.array(canvas)
|
||||||
next_gen_canvas = np.array(create_canvas(canvas.shape[0]))
|
next_gen_canvas = np.array(create_canvas(canvas.shape[0]))
|
||||||
@ -71,9 +71,7 @@ def run(canvas):
|
|||||||
pt, canvas[r - 1 : r + 2, c - 1 : c + 2]
|
pt, canvas[r - 1 : r + 2, c - 1 : c + 2]
|
||||||
)
|
)
|
||||||
|
|
||||||
canvas = next_gen_canvas
|
return next_gen_canvas.tolist()
|
||||||
del next_gen_canvas # cleaning memory as we move on.
|
|
||||||
return canvas.tolist()
|
|
||||||
|
|
||||||
|
|
||||||
def __judge_point(pt, neighbours):
|
def __judge_point(pt, neighbours):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user