From 617fecd87ad36aea6c6e0ffb56213fb4dfe47504 Mon Sep 17 00:00:00 2001 From: informaniac Date: Tue, 27 Dec 2016 03:01:54 +0100 Subject: [PATCH] if absolutely nothing has changed, stop calculating more frames --- gameOfLife.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gameOfLife.py b/gameOfLife.py index 44578f0..e6b96fb 100644 --- a/gameOfLife.py +++ b/gameOfLife.py @@ -89,4 +89,6 @@ for frame in range(500): newRow.append(DEAD) gameBoardNextStep.append(newRow) gameBoard = gameBoardNextStep + if(gameBoard == lastGameBoard): + break writebml.writeBml(animation, '/home/pi/animations/gameOfLife.bml')