Game of Life

I am working through projects in a new book. This chapter has us implementing the Game of Life. The book solution has you employing the numpy and matplotlib modules. I chose pyGame instead. I wanted to make my job easier. So I just forced the border to be all black (off) cells. And I never update them. That way I can check all the neighbors around the cells I do update, and don't have to worry about going off the grid.

It turns out Python is just too fast computing the new state of all the cells. Left alone, it proceeds so fast, I cannot experience the life cycle. So I just end up putting myself to sleep for a half second every iteration. That does the trick. When I let the simulation run, just as in the real world, everything dies out. Then I end up with a black screen. I had thought there might be some scenario where life repeats in a never ending pattern.

Popular posts from this blog

HTML Web Page Builder

Memories of Logo

Mission Accepted