public boolean isFinal()
	{
		// The following is borrowed from John Tromp and modified.
		// http://homepages.cwi.nl/~tromp/c4/fhour.html
		// It would have taken us some ugly loops to implement this function.
		long board = red;

		long y = board & (board>>6);
		if ((y & (y >> 2*6)) != 0) // check diagonal \
			return true;
		y = board & (board>>7);
		if ((y & (y >> 2*7)) != 0) // check horizontal -
			return true;
		y = board & (board>>8); // check diagonal /
		if ((y & (y >> 2*8)) != 0)
			return true;
		y = board & (board>>1); // check vertical |
		if((y & (y >> 2)) != 0)
			return true;

		board = white;

		y = board & (board>>6);
		if ((y & (y >> 2*6)) != 0) // check diagonal \
			return true;
		y = board & (board>>7);
		if ((y & (y >> 2*7)) != 0) // check horizontal -
			return true;
		y = board & (board>>8); // check diagonal /
		if ((y & (y >> 2*8)) != 0)
			return true;
		y = board & (board>>1); // check vertical |
		if((y & (y >> 2)) != 0)
			return true;

		/* Check if tie.
		if((red | white) == 0xfdfbf7efdfbfL)
			return true;*/

		return false;
	}