All pastes #248492 Raw Edit

Something

public text v1 · immutable
#248492 ·published 2006-11-14 18:54 UTC
rendered paste body
private int getNeighbours(LifeBoard board, int row, int col){
		
		int sum;
		for(int r=1; r<(row-1); r++)
			for(int c=1; c<(col-1); c++){
				sum=0;
				for(int x=r-1; x<r+1; x++)
					for(int y=c-1; y<c+1; y++){
						if(myBoard.get(x, y)){
							sum++;
						}
					}
				}
				
				return sum;
	
		
	}