4 ms·
Or simply: cell.live = count is 3 no?
by jashkenas 15y ago
Or simply:
cell.live = count is 3
no?
- ggchappell 15y agoNo. You aren't handling the case when count is 2 correctly. In that case, cell.live should remain unchanged, while you are setting it to false. (Note, however, that the code in the comment you are replying to is also incorrect. And does the same thing as your code. So you posted a correct transformation of incorrect code, that keeps it incorrect.)
- abarrett 15y agoThe original version still contains redundancy. It would be: cell.live = count == 3 if count != 2
- ggchappell 15y agoYes, that would do it.