calculates to which positions each piece can move