add algorithm

algorithm of selection pieces