in reply to Re: Life!
in thread Life!
use Storable 'dclone';for$y(0..23){$l[$_][$y]=int(rand 7)?0:1for(0..79 +)}while(1){@f=@{dclone\@l};print"\033[2J";for$y(0..23){for$x(0..79){p +rint$l[$x][$y]?O:" ";$n=0;for $h(-1..1){!$_&&!$h or$n+=$l[($x+$_)%79] +[($y+$h)%23]for-1..1}$l[$x][$y]?$n<2||$n>3?$f[$x][$y]=0:0:$n==3?$f[$x +][$y]=1:0}print$/}@l=@{dclone\@f};sleep 1}
cLive ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Life! (golf)
by jonadab (Parson) on Mar 21, 2004 at 00:59 UTC |