Rather than parsing the whole board, keep a hashset or list of all the cells that are live. Then apply the rules to all of those cells and their neighbours. Should avoid needlessly checking dead cells.
post
replies:
Rather than parsing the whole board, keep a hashset or list of all the cells that are live. Then apply the rules to all of those cells and their neighbours. Should avoid needlessly checking dead cells.
all 3 comments