On 2015-02-01 at 22:00, gedaiu wrote:
I implemented Conway's game of life in D.
I think you are playing a different game here.
/// Count cell neighbours
long neighbours(Cell myCell, CellList list) {
long cnt;
foreach(cell; list) {
auto diff1 = abs(myCell.x - cell.x);
auto diff2 = abs(myCell.y - cell.y);
if(diff1 == 1 || diff2 == 1) cnt++; // Why || instead of && ???
}
return cnt;
}
