Function attacks

Gets squares attacked or defended by a piece on square, given occupied squares.