elegant-scipy / elegant-scipy-submissions

Submissions of code snippets for the book Elegant SciPy
13 stars 2 forks source link

Game of Life in 12 lines of python #19

Closed rougier closed 8 years ago

rougier commented 9 years ago

Author: Nicolas Rougier (@rougier) Submitted by: Nicolas Rougier (@rougier)

This is the game of life (cellular automata) in 10 lines of python with numpy. The code is available from http://www.labri.fr/perso/nrougier/teaching/numpy.100/ (last question). (code explanations is available from http://www.labri.fr/perso/nrougier/teaching/numpy/numpy.html)

I would also recommend other questions from the same source but I don't know if they fit the elegant scipy submissions.

jni commented 9 years ago

@rougier very cool, thank you! We are actually planning to use scipy.ndimage.generic_filter to implement it, so this would be a very cool complementary approach to have!

btw we are specifically looking for more examples of generic_filter in practice, if you have any. =)

Thank you again!

rougier commented 9 years ago

Yes, just made one, I will open a new issue.

hdashnow commented 8 years ago

This will be an exercise. Thanks @rougier!