On 03 Sep 08, at 02:23, RGA wrote:
In trying to get my head around some design patterns for cocoa, I thought about the game of life (eg http://www.bitstorm.org/gameoflife/) . This is where you have a grid of cells, and dependant on the number of live cells around a given cell it dies, comes to life, or remains unchanged.

In an object model I could see a grid of cells which all keep a track of the number of "live" neighbours based on messages it receives from them about whether they have become alive or have died. In the event that a message from a neighbour cell triggers a state change of the cell (ie it comes to life or dies) it in turn would send out messages to all it's neighbours about it's state change and they in turn would adjust their counts and subsequently come to life or die.

Putting aside for now whether this is the right way to implement...

Just for the record, it isn't. The Game of Life depends on all transitions taking place simultaneously; performing transitions on a tickless basis like this will not work correctly.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to