Conway's game of life

Foo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 1 13:54:41 PST 2015


On Sunday, 1 February 2015 at 21:00:07 UTC, gedaiu wrote:
> Hi,
>
> I implemented Conway's game of life in D. What do you think that
> I can improve to this program to take advantage of more D
> features?
>
> https://github.com/gedaiu/Game-Of-Life-D
>
> Thanks,
> Bogdan

For each remove you create a new array. That is lavish. You 
should use a bool inside the struct Cell. If it's false, the cell 
is not displayed and is out of the game.
My suggestion: don't use the D GC, it's crap. Try to circumvent 
the GC wherever possible. Therefore you should use the -vgc 
compiler flag and the @nogc attribute.


More information about the Digitalmars-d-learn mailing list