Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Blue

Member Since 16 Aug 2011
Offline Last Active Sep 25 2011 09:30 PM
-----

Topics I've Started

Conway Game of Life

08 September 2011 - 03:32 PM

Ok...here goes my first post to the Netduino forums. Here is my first project beyond blinking the LED.

I picked up a Netduino at Detroit Maker Faire a few months back and I love this little thing. Soon after, I ordered a Nokia 5110 LCD from ebay. After playing around with the Nokia library, I decided this would be a good display to play Conway's Game of Life. (See wikipedia)

The project contains 2 game classes: gameOfLife1 and gameOfLife2
gameOfLife1 - this is a straight-forward implementation of the game of life algorithm. The code is intuitive, it checks each bit and counts the number of living neighbors. Unfortuneately this is painfully slow. It takes an average of 11 seconds to calculate the next generation on a randomized game board.

gameOfLife2 - this is a slightly optimized version of gameOfLife1. This class checks blocks of cells to skip large blank areas. This offers a moderate speed increase. It takes an average of 4 seconds to calculate the next generation on a randomized game board. The gameOfLife2 class also implements the game board into a torroid shape. This means if a colony expands to the border of the screen, it will wrap to the opposite edge.

Here is a link to an ugly video: the Youtubes

Here is a nice little animation to show what the game looks like running a few generations of the Gosper Glider Gun...
Posted Image

I would love to see examples if anyone else if working on a game of life for Netduino

For next steps (once I get some free time), I plan to further optimize the game. I would like to get the refresh speed below 1 second per generation

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.