CocoLife: a Cocoa version of “Game of Life”

May 22, 2008

Since my mental illness is still not cured, and I’m very much into this “game of life” thing, I also developed a version of Conway’s game of life for Mac OS X using Objective-C and the framework Cocoa.

Esthetically speaking the Cocoa version is much more cool then the Java one… but the algorithm is actually the same. I named it “CocoLife” fusing “Cocoa”, the name of the framework I used, and “Life”. The application’s icon represent a particular configuration of the game of life called “glider”.

Since I cured much more the develop of this version I filled up the application with many “cool” features! In CocoLife is possible to:

 

  • Configure the colors of background and automata
  • Choose between 4 different world sizes (50×50, 100×100, 250×250 and 500×500)
  • Choose the world type (bordered-world or loop-world)
  • Change the execution speed of the simulation modifying the interval of pause between transitions
  • Create personal world configurations using the bult-in world-editor

The application, released under the license GNU GPL v2, requires Mac OS X 1.5 Leopard to work.  

Download CocoLife from here:

 


A “single line of code” browser with Cocoa

April 10, 2008

I really enjoy developing on Mac OS X… especially thanks to XCode and Cocoa (what a superb framework)!

What makes Cocoa such a great tool is letting you concentrate on your project making easy accessing to all those low-level “stuff” that always slow down your work! For example… it is possible to create an essential browser writing down just a single line of code (of course after making the UI graphically with Interface Builder)!

Once you’ve set up the UI with a textfield, a button and a webview all you need to write is:

[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: [urlText stringValue]]]];

Don’t you think that all this is so cool? I mean… for example, if you’re working on an RSS aggregator you can just spend time working on the core task of the application avoiding the waste of time derived from implementing a built-in browser for rendering news!

You can download the xcode project of “single line of code browser” clicking here!