All pastes #44734 Raw Edit

Unnamed

public text v1 · immutable
#44734 ·published 2006-03-07 01:23 UTC
rendered paste body

public class Coordinate()
{

	int[][] myCoordinateList = new int[5][2];

	public void test(){

	myCoordinateList[0][0] = 1;
	myCoordianteList[0][1] = 0;
	/*
	<nopass> <x>2</x> <y>0</y> </nopass>
	<nopass> <x>3</x> <y>0</y> </nopass>
	<nopass> <x>4</x> <y>0</y> </nopass>
	<nopass> <x>59</x> <y>0</y> </nopass>
	<nopass> <x>60</x> <y>0</y> </nopass>
	*/
	}

	public boolean isPassable(int x, int y){
	
	for(int i = 0; i < myCoordinateList.length; i++)
	{
		if(myCoordinateList[i] == x)
		{
			for(int j = 0; j < myCoordinateList[0].length; j++)
			{
		   		if(myCoordinateList[j] == y) //the coordinate is in the nopass list
					return false;
			}
		}
	}
	//if we're here, we've iterated through and not found the coordinate in nopass
	return true;
	}
}