r/madeinpython • u/slipped_and_missed_x • May 05 '20
Conway's Game Of Life in 13 lines of code using kernel convolutions
30
Upvotes
4
u/awesomeprogramer May 05 '20
So you're just using convolution to count the neighbors? Then that really long line is applying the rules as a long Boolean expression? Anything else?
2
u/slipped_and_missed_x May 05 '20
No that's basically it. I'm not really trying to anything particularly valuable here I just think it's neat
2
u/awesomeprogramer May 05 '20
It is really neat! I wonder what a cuda enabled pytorch version would look like. Definitely overkill, bit could be fun.
5
0
4
u/69shaolin69 May 05 '20
Not hating or anything but Is it 13 lines? I see a line extending far beyond pep8 standard. Like 10x times long.