Conway’s Game of Life in Minecraft Pi Edition

Also known as “The slowest implementation of the Game of Life in 2013″. This is what happens when you have insomnia.

[pe2-image src=”http://lh3.ggpht.com/-pIMUUJNK__k/URzHojTQSAI/AAAAAAAACxQ/MCZeLIlpebE/s144-c/IMG_20130214_031548.jpg” href=”https://picasaweb.google.com/100175922620194527589/InstantUpload#5844765915904755714″ caption=”IMG_20130214_031548.jpg” type=”image” alt=”IMG_20130214_031548.jpg” ]

What I did was first clear out the entire world, then place a plane of glass across the entire world at y=1. The actual Life cells are Cobblestone blocks on the y=0 plane (the grid is on the Minecraft x-z axis). The Life grid is initialized with a random seed, then set off to work. This code for the Game of Life is about the dumbest and slowest implementation there is. I’ve done no optimization at this point. It only updates about one generation (over the entire world) every few minutes. But it does seem to work, as you can see above.

Next time I need a break from electronics, I’ll refine the code and post it again (or you can follow the Gist). It’s way too slow to run the entire world as a Life simulation, so I think I’ll just clear out a 64×64 space in the middle of the world and confine the world to that size, which should make things run about an order of magnitude faster, I would hope. I know, this is crap code, but I’m still trying to really get into the Python frame of mind and this was a quick hack any way.

I’ll let this thing run for a while and post a screenshot of the evolved world to Twitter and G+ later on. Also, thanks to the shoutout from the new http://mcpipy.wordpress.com/ blog!

Leave a Reply