in reply to
Re: My Conway's Game Of Life Attempt
in thread My Conway's Game Of Life Attempt
The intent of the substr pair would be clearer as:
substr($new_world->[$y], $x, 1) = ( $n == 3 ? '0' : ' ' );
Wouldn't that kill the cell if its $n == 2 and its alive? Basicaly if its $n==2 then the cell remains alive or dead, whichever it was already, dies if its $n<2 or $n>3, and becomes alive if $n==3.
Results (224 votes),