All pastes #14166 Raw Edit

Someone

public java v1 · immutable
#14166 ·published 2005-06-12 21:56 UTC
rendered paste body
public static boolean isAlive(int xPos, int yPos)    {    	System.out.println("xpos:"+xPos+" "+yPos);    	System.out.println("xdim:"+xDim+" "+yDim);    	    	if(xPos < 0 && yPos < 0 && grid[xDim-1][yDim-1].alive == true)    	{    		return true;    	}    	else if( xPos <= xDim && yPos <= yDim && grid[0][0].alive == true)    	{    		return true;    	}    	else if(xPos < 0 && grid[xDim-1][yPos].alive == true)    	{    		return true;    	}    	else if(xPos <= xDim && grid[0][yPos].alive == true)    	{    		return true;    	}    	else if(yPos < 0 && grid[xPos][yDim-1].alive == true)    	{    		return true;    	}    	else if(yPos <= yDim && grid[xPos][0].alive == true)    	{    		return true;    	}    	else    	{    		return false;    	}	    	    }