def main(argv):
	'''
	parse chess output to a simple move file
	'''
	arguments = parseArguments(argv[1:])
	
	for line in sys.stdin:
		try:
			piece,from_fen,to_fen = line.split("\t")
			from_piece_placement_array = fen_to_piece_placement_array(from_fen)
			to_piece_placement_array = fen_to_piece_placement_array(to_fen)
			from_location, to_location = find_from_to(piece, \
				from_piece_placement_array, to_piece_placement_array)

			surround = find_surround(from_location, from_piece_placement_array,\
				arguments.radius)

			print "%s\t%s,%s\t%s,%s\t%s" \
			% (piece, from_location[0],from_location[1] , \
				to_location[0], to_location[1], ";".join(surround))
		except:
			pass
dataset/ETHPy150Open nivm/learningchess/chess/complexmove/simplemove.py/main/original