def find_surround(location, board_array, radius=1):
	'''
	Construct list representing the surrounding of radius
	x - spot is occiupied
	y - spot is clear
	z - spot is out of the board
	o - piece itself

	example - [y,y,z,y, o, z, z, z, z]
	This is the surround of radius 1 for the right
	whie rook on the opening position
	'''
	x,y = location[0], location[1]
	surround = []
	for i in xrange(-radius, radius+1):
		for j in xrange(-radius, radius+1):
			try:
				if j==0 or i == 0:
					surround.append("o")
					continue
				if board_array[y+i][x+j]==1:
					surround.append("y")
				else:
					surround.append("x")
			except:
				surround.append("z")
	return surround
dataset/ETHPy150Open nivm/learningchess/chess/complexmove/simplemove.py/find_surround/operator `and` -> `or`