[Israel.pm] Game of life in 2 lines - An Introduction to Threading in PDL

Avishalom Shalit avishalom at gmail.com
Wed Nov 18 04:41:07 PST 2009


maybe not what they were trying to demonstrate.
but using 2 d convolution is more elegant

convolve the board  (B) with ones(3,3) to get the number of
neighbors(N) including the self

and resisting an urge to golf, but still it is more elegant for the update rule

N-B== 3  | N==3


-- vish



2009/11/16 Gabor Szabo <szabgab at gmail.com>:
> The page was written by Matthew Kenworthy
> and it is supposed to be a gentle introduction to PDL threading,
> ending with a description of a two line PDL threaded Game of Life:
>
> http://sourceforge.net/apps/mediawiki/pdl/index.php?title=Introduction_to_PDL_Threading
>
> This is what we are planning to talk about during the Rehovot.pm
> meeting tomorrow.
>
> http://szabgab.com/blog/2009/11/1257443063.html
>
> Gabor
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
>


More information about the Perl mailing list