g | x | w | all
Bytes Lang Time Link
004Jelly250817T201712ZUnrelate
043Haskell250817T190433ZHayden B
035APLNARS250810T130239ZRosario
041AWK250808T143041Zxrs
012Uiua231016T082033ZBubbler
060sed E230610T053555ZYelp
036Perl 5 aE230609T202200Zplentyof
035Wolfram Language Mathematica230609T063715Zatt
005Thunno 2230607T212309Zchunes
006Nekomata230607T030822Zalephalp
068Julia 1.0230118T223529ZAshlin H
065Nibbles230130T210817ZAdam
nanFig230118T013130ZFmbalbue
012Pip230117T174555ZBaby_Boy
012BQN230120T204427ZJacobus
060C gcc230118T063459ZPeter
034Curry PAKCS230118T072805Zalephalp
115Go230117T215126Zbigyihsu
004Vyxal210929T083757Zemanresu
010Japt230116T191325ZShaggy
041JavaScript Node.js230117T143235Zl4m2
071C# Visual C# Interactive Compiler190215T044935Zdana
nan230116T170521ZThe Thon
012k9211006T111149Zchrispsn
065Scala211004T221316Zuser
058jq211003T010722ZSara J
041C gcc190330T123629Zatt
095Java JDK210929T084556Z0xff
035Factor210929T094635Zchunes
055Zsh190330T000228ZGammaFun
106Common Lisp190313T104925ZRenzo
034Ruby190313T102121ZG B
021APL Dyalog Unicode190215T012858Zvoidhawk
022J190215T175723ZJonah
057R170731T201920ZGiuseppe
028Perl 6190215T002550ZJo King
067PHP190214T222445Z640KB
093Java 8170804T042013ZJakob
071C++17170804T020322ZKarl Nap
013Pyth170731T195539ZDave
038Perl170731T232423Zbytepush
016Japt170731T195825ZETHprodu
043JavaScript ES6170731T214332ZNeil
053JavaScript Node.js170731T214232ZAsaf
052Mathematica170801T110255ZMr.Wizar
007Jelly170731T195134ZErik the
111C# .NET Core170731T210806ZGrzegorz
091Scala170801T031104ZPhoenix
072WendyScript170731T235000ZFelix Gu
012Japt170731T230348ZJustin M
009MATL170731T220207ZLuis Men
041JavaScript ES6170731T220520ZRick Hit
203Emojicode170731T214250Zbetseg
057Mathematica 57 Bytes170731T213050ZKelly Lo
088Mathematica170731T212502ZZaMoC
062JavaScript Node.js170731T210627ZRa8
046Python170731T200724Zxnor
00505AB1E170731T195830ZAdnan
007Gaia170731T200735ZBusiness
071JavaScript170731T195728Zuser7234
070Python 3170731T195949ZBusiness
101Python 3170731T195515ZMr. Xcod

Jelly, 4 bytes

Ṫ{Ɱ+

Try it online!

Ṫ       Pop the last element of the input
 {Ɱ     for each element of the input, in order, while there is a next element.
   +    Add to the remaining elements.

Jelly, 6 bytes

J«U$Sƙ

Try it online!

    S     Sum
     ƙ    each group of elements which have the same
 «        minimum of
J         their 1-indices from the beginning
  U$      and from the end.

Haskell, 43 bytes

Edit: this is embarrassing, but I completely glossed over the Haskell example. Well, enjoy this (slightly worse one) one anyway :)

f[]=[]
f[x]=[x]
f(x:s)=(x+last s):f(init s)

APL(NARS), 35 chars

{w←(k←⌊2÷⍨≢⍵)↑⍵+⌽⍵⋄2∣≢⍵:w,⍵[k+1]⋄w}

test:

   f←{w←(k←⌊2÷⍨≢⍵)↑⍵+⌽⍵⋄2∣≢⍵:w,⍵[k+1]⋄w}
   f 1 2 3 4
5 5 
   f 1 2 3 4 5
6 6 3 
   f ,1
1 
  f 1 2
3 

AWK, 56 41 bytes

{for(i=NF;i>NF/2+NF%2;$(i--)=X)$++j+=$i}1

Attempt This Online!

{for(;i++<int(NF/2);)printf$i+$(NF-y++)FS}1,$0=NF%2?$i:X

Uiua, 12 bytes

⬚0+⇌⊃↘↙⌊÷2⧻.

Try it online!

⬚0+⇌⊃↘↙⌊÷2⧻.   input: a numeric vector
           ⌊÷2⧻     half of length, rounded down (let's call it k)
     ⊃↘↙     .   fork(drop, take): first k elements removed, first k elements
   ⇌               reverse the top
⬚0+                elementwise add, filling with zeros when lengths don't match

sed -E, 60 bytes

s/^/</
:a
s/<(!*);(.*;)?(!*);$/\1\3,<\2/
ta
s/[<;]//g
s/,$//

Only works with zero and positive numbers. Input is repeated exclamation marks separated by semicolons. Output is repeated exclamation marks separated by commas.

Try it online!

Perl 5 -aE, 36 bytes

map{$F[$_]+=pop@F}0..$#F/2-1;say"@F"

Takes advantage of the autosplit flag and iterates through the first half (rounded down) of the resulting list, modifying it in-place.

Slightly ungolfed:

for (0 .. ($#F / 2) - 1) {
    $F[$_] += pop(@F);
}
say "@F";

Try it online!

Wolfram Language (Mathematica), 35 bytes

Set[f[a_,b___,c_],a+c,f@b]
f@a___=a

Try it online!

Input [list...]. Returns a sequence.


Wolfram Language (Mathematica), 39 bytes

f@{a_,b___,c_}:={a+c,##&@@f@{b}}
f@a_=a

Try it online!

Input and output a list instead of a sequence.

Thunno 2, 7 5 bytes

2ẆẸr+

Attempt This Online!

2ẆẸr+ # implicit input
2Ẇ    # split list in half
  Ẹ   # push both halves to the stack
   r  # reverse top one
    + # vectorized addition
      # implicit output

Nekomata, 6 bytes

;ᶜç↔ᶻ+

Attempt This Online!

;ᶜç↔ᶻ+
;       Nondeterministically split the input into two parts
 ᶜç     Optionally prepend a zero to the second part
   ↔    Reverse the second part
    ᶻ+  Zip with addition

The + operator is automatically vectorized, but it does not check if the two operands have the same length. So here I use (\zip) to make sure that the two parts are of equal length.

Julia 1.0, 69 68 bytes

!s=(~=length;~s%2>0&&insert!(s,(1+~s)÷2,0);(s+reverse(s))[1:~s÷2])

Try it online!

-1 byte thanks to MarcMush: replace ==1 with >0

Nibbles, 6.5 bytes

/`\~_!:\@0@+

Attempt This Online!

/   Fold
`\~  split into two parts
_     input (row from STDIN as a list of integers)
!    zip
:     join
\      reverse
@       the second part
0      0
@     the first part
+     with addition

Fig, \$23\log_{256}(96)\approx\$ 18.932 bytes

J+t_HLxxt_HLx$xs_HLxtHL

Try it online!

\$-26\log_{256}(96)\approx21.401\$ thanks to Seggan

First time using Fig. Any golfing tips are welcome.

Explanation (outdated):

fw+[yfy$fy$fyx[yfy$fy$fy$x?h%1HLx[]yfy$fy$fyx]yW1
   [yfy$fy$fyx                                    First Mid
  +                                               Add
              [yfy$fy$fy$x                        Second Mid
fw                                                Concat
                          ?                       If
                           h%1HLx                 List length is odd,
                                 []yfy$fy$fyx     Mid
                                             ]yW1 Else Empty list

Pip, 14 12 bytes

YCHa;@y+Ry@1

-2 Thanks to DLosc!

How?

YCHa;@y+Ry@1  : One arg; list
   a          : First input
 CH           : Chop iterable into 2 pieces of roughly equal length
Y             : Yank value
         y    : The two halves
          @1  : Get item/slice at index 1; The second half
        R     : Reverse
       +      : Add with
      y       : The two halves
     @        : Get item at index 0; The first half

Try It Online!

BQN, 15 12 bytes

(⌊≠÷2˙)⊸↑⊢+⌽

Try it online!

-3 thanks to Marshall Lochbaum

Sum the list and its reverse, then take the first ⌊≠÷2˙ digits. ⌊≠÷2˙ the floor of the length divide 2. Floor is necessary because there is no integer division in BQN. is used to bind the output of ⌊≠÷2˙ to the take operator on the left and also puts the output of (⊢+⌽) on the right. Better explanation here.

C (gcc), 62 bytes 60 bytes

-2 bytes thanks to @ceilingcat

i;f(v,l)int*v;{for(i=0;i<l/2;++i)v[i]+=v[l+~i];return~l/-2;}

f is a function taking vector (v) and length (l) as arguments. It modifies the vector and returns the new length.

Try It Online!

How it works:

i;
f(v,l) int*v; // v is an integer pointer (or array), l is an integer
{
    for (i = 0; i < l / 2; ++i) // iterate through half the indices using i (if l is odd, the middle element won't be included)
        v[i] += v[l + ~i]; // add the value at the i'th index from the back to the i'th index from the front. ~i == -i - 1, so l + ~i == l + -i -1 = l - i - 1 (l - 1 is the first index from the back, and we subtract i for each index beyond the first)
    return ~l / -2; // return half the length rounded up (~l == -l - 1 => ~l / -2 == (-l - 1) / -2 => (l + 1) / 2
}

Curry (PAKCS), 34 bytes

f(a:b++[c])=a+c:f b
f x@([]?[_])=x

Attempt This Online!

Based on the sample implementation in Haskell.

Go, 115 bytes

func(x[]int)(o[]int){s:=len(x)
for i:=range x[:s/2]{o=append(o,x[i]+x[s-i-1])}
if s%2>0{o=append(o,x[s/2])}
return}

Attempt This Online!

Generic with custom operator, 136 bytes

func f[T any](x[]T,O func(T,T)T)(o[]T){s:=len(x)
for i:=range x[:s/2]{o=append(o,O(x[i],x[s-i-1]))}
if s%2>0{o=append(o,x[s/2])}
return}

Attempt This Online!

Vyxal, 4 bytes

I÷Ṙ+

Try it Online!

I    # Halve the list
 ÷   # Push each half
  Ṙ  # Reverse the second half
   + # Add them together (vectorising)

Japt, 10 bytes

There's gotta be a 9 here, somewhere.

òUÊ/2 oÔyx

Try it

òUÊ/2 oÔyx     :Implicit input of array U
ò              :Partitions of length
 UÊ            :  Length of U
   /2          :  Divided by 2
      o        :Modify last element
       Ô       :  Reverse
        y      :Transpose
         x     :Reduce each by addition

Also 10 bytes

íUÔoUÊz¹mx

Try it

íUÔoUÊz¹mx     :Implicit input of array U
í              :Interleave with
 UÔ            :  Reverse U (mutates the original)
   o           :  Pop this many items (also mutates the original)
    UÊ         :    Length of U
      z        :    Floor divided by 2
       ¹       :End interleave
        m      :Map
         x     :  Reduce by addition

JavaScript (Node.js), 41 bytes

f=([b,...c])=>1/b?[b+~~c.pop(),...f(c)]:c

Try it online!

So many ways to reach 41

C# (Visual C# Interactive Compiler), 71 bytes

x=>{int i=0,l=x.Length;for(;i<l/2;)x[i]+=x[l-++i];return x[..(l-l/2)];}

Try it online!

-2 bytes thanks to @ceilingcat!

Thunno, \$ 10 \log_{256}(96) \approx \$ 8.23 bytes

2APAur0Tz+

Attempt This Online!

Sort-of port of Adnan's 05AB1E answer

Explanation:

2APAur0Tz+  # Implicit input
2AP         # Split in half
   Au       # Dump onto stack
     r      # Reverse top item
      0T    # Append a 0
        z+  # Zipped addition

Thunno's normal addition (+) will provide a nested list of each element of the first list plus each element of the second list.

Thunno's zipped addition (z+) zips the two lists together, discarding items if they are not of equal length.

So, we must append a 0 to the top list (since it will be the shorter one if the input contained an odd number of items) and then use zipped addition.

k9, 12 bytes

+/++(;|)@'2^

Version 2021.09.20.

Cut in two, reverse second list, pad with zeroes, add.

Scala, 65 bytes

l=>l take(l.size+1)/2 zipAll(l.reverse take l.size/2,0,0)map(_+_)

Try it in Scastie!

jq, 58 bytes

[reverse[:length/2],.[:length/2|floor]]|transpose|map(add)

Try it online!

C (gcc), 55 41 bytes

f(_,l)int*_;{for(;l--;*_+++=l?_[l--]:0);}

Try it online!

Overwrites the first \$\left\lfloor\frac{l}{2}\right\rfloor\$ entries of the input array.

C (gcc), 46 bytes

f(_,l)int*_;{_=l>1?*_+=_[l-1],1+f(_+1,l-2):l;}

Try it online!

Additionally returns the length \$\left\lceil\frac{l}{2}\right\rceil\$ of the output.

Java (JDK), 102 95 bytes

i->{int l=i.length,o=l/2+l%2,r[]=new int[o];for(;o-->0;)r[o]=i[o]+(o<l+~o?i[l+~o]:0);return r;}

Try it online!

-7 Thanks to Kevin Cruijssen

Factor, 35 bytes

[ halves reverse 0 pad-longest v+ ]

Try it online!

Explanation

It's a quotation (anonymous function) that takes a sequence from the data stack and leaves a sequence on the data stack. Assuming { 1 2 3 4 5 6 7 } is on the data stack when this quotation is called...

Snippet Comment Data stack (top on right)
halves Split a sequence in half { 1 2 3 } { 4 5 6 7 }
reverse Reverse a sequence { 1 2 3 } { 7 6 5 4 }
0 pad-longest Pad the shorter of two sequences with 0s until it's the same length as the longer sequence { 1 2 3 0 } { 7 6 5 4 }
v+ Vector addition; element-wise addition between two sequences { 8 8 8 4 }

Zsh, 55 bytes

If the answer must be put to stdout, but output whitespace is flexible, 55 bytes:

for ((;++i<=#/2;))<<<$[$@[i]+$@[-i]]
<<<$@[#%2*(1+#/2)]

Try it online!


If the output must be stored in an array, 53 bytes: (We can't use this method in place of the above because of <<<...[--i].... The here-string forces a subshell, so the decremented value of i never makes it out.)

for n ($@[1,#/2])y+=($[$@[--i]+n])
y+=$@[#%2*(1+#/2)]

Try it online!

If the answer must be output in one line separated by spaces, then append <<<$y for a 6 byte penalty.


Zsh arrays are indexed from the start starting at 1, or from the end starting at -1. So what happens if you attempt to index at 0? Well, nothing! We take advantage of that here to only output the middle number based on a parity check:

$@[#%2*(1+#/2)]
   #      #       # parameter count
       (1+#/2)    # index of the middle element when count is odd
   #%2*(1+#/2)    # multiply by 0 if even, or 1 if odd
$@[           ]   # Index the parameter array

Common Lisp, 106 bytes

(lambda(l)(setf(values a b)(floor(length l)2))`(,@(#1=subseq(mapcar'+ l(reverse l))0 a),@(#1#l a(+ a b))))

Try it online!

Ruby, 34 bytes

f=->l{l[1]?[l.shift+l.pop]+f[l]:l}

Try it online!

APL (Dyalog Unicode), 21 bytesSBCS

-3 bytes thanks to @Adám.

(⌊2÷⍨≢)(↑{+⌿↑⍺⍵}∘⌽↓)⊢

Try it online!

Explanation:

(⌊2÷⍨≢)(↑{+⌿↑⍺⍵}∘⌽↓)⊢  ⍝ Monadic function train
(⌊2÷⍨≢)                  ⍝ Left portion:
     ≢                   ⍝ Take the length of the input...
  2÷⍨                    ⍝ Divide it by two...
 ⌊                       ⍝ And floor it. This gives our midpoint index. Call it "X"
                      ⊢  ⍝ Right portion: return the original input. Call it "Y"
       (↑{+⌿↑⍺⍵}∘⌽↓)   ⍝ Midddle portion: takes X and Y as arguments
        ↑           ↓    ⍝ Take and drop Y by X. Essentially splits Y in half
                         ⍝ Presents the two halves to the next function
                 ∘⌽     ⍝ Reverse the second half
         {+⌿↑⍺⍵}       ⍝ Final function, takes first half and reversed second half
              ⍺⍵        ⍝ Construct a nested list of first and second halves...
             ↑          ⍝ ...and "mix" them into a matrix. Has the nice property that
                        ⍝ it will pad the first half with a zero if needed.
          +⌿           ⍝ Sum the matrix along the columns, return resulting vector

J, 22 bytes

({.+/@,:|.@}.)~>.@-:@#

Try it online!

R, 81 70 68 57 bytes

function(l)c((l+rev(l))[1:(w=sum(l|1)/2)],l[w+1][!!w%%1])

Try it online!

anonymous function; returns the result.

Perl 6, 28 bytes

{.[^*/2]Z+.[$_-1...$_/2,$_]}

Try it online!

Explanation:

{                          }   # Anonymous code block
 .[^*/2]                       # The first half of the list
        Z+                     # Zip added to
          .[$_-1...$_/2        # The other half of the list
                       ,$_]    # And zero for the middle element

PHP, 67 bytes

function($l){while($l)$o[]=array_shift($l)+array_pop($l);return$o;}

Try it online!

Java 8, 93 bytes

Double digits! This is a lambda that takes an int[] and returns an int[].

l->{int n=l.length,i=0;for(;i<n/2;)l[i]+=l[n-++i];return java.util.Arrays.copyOf(l,n/2+n%2);}

Ungolfed lambda

l -> {
    int n = l.length, i = 0;
    for (; i < n / 2; )
        l[i] += l[n - ++i];
    return java.util.Arrays.copyOf(l, n / 2 + n % 2);
}

Quite straightforward. It folds the second half in place onto the first half of the input and returns a copy of just the first half.

Surprisingly, the array copy in the return statement seems to be the cheapest way to handle the final element quirk for odd-length inputs.

C++17, 75 73 71 bytes

As unnamed lambda, accepting a container like vector or list, returns via modifying the input:

[](auto&L){for(auto a=L.begin(),b=L.end();a<--b;L.pop_back())*a+++=*b;}

Using the well known 'goes-to' operator <-- and the triple plus +++

Ungolfed and example:

#include<iostream>
#include<vector>

using namespace std;

auto f=
[](auto&L){
 for(
  auto a=L.begin(),b=L.end();
  a<--b;
  L.pop_back()
 )
 *a+++=*b;
}
;

void test(auto L) {
 for(auto x:L)cout << x << ", ";
 cout << endl;
 f(L);
 for(auto x:L)cout << x << ", ";
 cout << endl << endl;
}

int main() { 
 vector<int> A = {1,2,3,4,5,6,7,8}, B = {1,2,3,4,5,6,7};
 test(A);
 test(B);
}

Pyth, 18 17 13 bytes

V.Tc2Q aYsN;Y

My original approach was

WtQ aY+.)Q.(Q0;+Y

-1 byte thanks to Mr. Xcoder

-4 bytes thanks to FryAmTheEggman

Perl, 42 38 chars

sub f{@a=map{$+pop}splice@,0,@/2;@a,@}

sub f{(map{$_+pop}splice@_,0,@_/2),@_} 

Try for example like so:

perl -e 'my @input=(1..9); sub f{(map{$_+pop}splice@_,0,@_/2),@_}  print join(",",f(@input));

Japt, 21 18 16 bytes


l
íUj°V/2V w)mx

Test it online!

Completely awful Slightly less awful thanks to @Oliver. BRB after I implement more built-ins and fix some bugs...

JavaScript (ES6), 46 43 bytes

f=(a,[b,...c]=a)=>c+c?[b+c.pop(),...f(c)]:a

f=(a,[b,...c]=a)=>c+c?[b+c.pop(),...f(c)]:a

console.log(f([1,2,3,4,5,6,7,8]).join(', ')) // 9, 9, 9, 9  ✓
console.log(f([1,2,3,4,5,6,7]).join(', '))   // 8, 8, 8, 4  ✓
.as-console-wrapper{max-height:100%!important}

Saved 3 bytes with inspiration from Asaf.

JavaScript (Node.js), 53 bytes

x=>x.splice(0,x.length/2).map(y=>y+x.pop()).concat(x)

Try it online!

Another suggestion:

JavaScript (Node.js), 43 bytes

f=x=>x+x?[x.pop()+(0|x.shift()),...f(x)]:[]

Try it online!

Mathematica, 52

(a=#;i=0;(i++;a[[i;;-i]]*=x)&/@a;(Tr@a+O@x^i)[[3]])&

Jelly, 7 bytes

œs2U2¦S

Try it online!

-2 thanks to ETHproductions...and me realizing before.

C# (.NET Core), 118 111 bytes

a=>a.Reverse().Zip(a,(c,d)=>c+d).Take(a.Length/2).Concat(a.Skip(a.Length/2).Take(a.Length%2))

Byte count also includes

using System.Linq;

Try it online!

As input please use numbers separated either with commas (,) or space. Explanation:

a =>                                  // Take one input parameter (array)
a.Reverse()                           // Reverse it
.Zip(a, (c, d) => c + d)              // Take every corresponding member of reversed
                                      //    and original, and add them together
.Take(a.Length / 2)                   // Get first half of the collection
.Concat(                              // Add another collection
    a.Skip(a.Length / 2)              // Take input and leave out first half of it
    .Take(a.Length % 2)               // If length is odd, take first element (so the middle)
                                      //    otherwise create an empty collection
);

Scala, 91 bytes

(s:Seq[Int])=>(s.take(s.size/2),s.reverse).zipped.map(_+_)++s.drop(s.size/2).take(s.size%2)

WendyScript, 72 bytes

<<f=>(l){<<r=[]<<b=l.size#i:0->b/2r+=l[i]+l[b-i-1]?b%2!=0r+=l[(b/2)]/>r}

f([1,2,3,4,5,6,7,8]) // => [9,9,9,9]
f([1,2,3,4,5,6,7]) // => [8,8,8,4]

Try it online!

Japt, 12 bytes

å@o +Y*(Z<Ul

Try it online! with the -Q flag to view the formatted array.

Alternate solution, 14 bytes

o(½*Ul)c)íU mx

Try it online!

MATL, 9 bytes

`6L&)swtn

Try it online!

How it works

Given an array [a b c ... x y z], let [a z] be called the "crust" subarray and [b c ... y z] the "core" subarray.

The code consists in a loop that removes the crust, computes its sum, and moves the core to the top of the stack, ready for the next iteration. The loop condition is the number of elements in the core subarray

`       % Do...while
  6L    %   Push [2 -1+1j]. As an index, this is interpreted as 2:end-1
  &)    %   2-output reference indexing: pushes a subarray with the indexed 
        %   elements (core) and another with the ramaining elements (crust)
  s     %   Sum of (crust) subarray
  w     %   Swap. Moves the core subarray to the top
  t     %   Duplicate
  n     %   Number of elements.
        % End (implicit). Procced with next iteration if top of the stack is
        % nonzero; else exit
        % Display stack (implicit)

JavaScript (ES6), 41 bytes

f=a=>1/a[1]?[a.shift()+a.pop(),...f(a)]:a

f=a=>1/a[1]?[a.shift()+a.pop(),...f(a)]:a

console.log(JSON.stringify(f([1,2,3,4,5,6,7,8])));
console.log(JSON.stringify(f([1,2,3,4,5,6,7])));

Emojicode, 203 bytes

🐋🍨🍇🐖🔢🍇🔂i⏩0➗🐔🐕2🍇😀🔡➕🍺🔲🐽🐕i🚂🍺🔲🐽🐕➖🐔🐕➕1i🚂10🍉🍊😛1🚮🐔🐕2🍇😀🔡🍺🔲🐽🐕➗🐔🐕2🚂10🍉🍉🍉

This was the most painful Emojicode answer to code for me. The unnecessary length :/

Try it online!

Mathematica 57 Bytes

(#+Reverse@#)[[;;d-1]]&@Insert[#,0,d=⌈Length@#/2⌉+1]&

Inserts a zero at the midpoint, adds the list to its reverse and takes the appropriate length.

Mathematica, 88 bytes

(d=Array[s[[#]]+s[[-#]]&,x=⌊t=Length[s=#]/2⌋];If[IntegerQ@t,d,d~AppendTo~s[[x+1]]])&

JavaScript (Node.js), 62 bytes

a=>a.map((e,i)=>e+a[c=(b=a.length)-i-1]*(c!=i)).slice(0,++b/2)

Try it online!

Python, 46 bytes

f=lambda l:l[1:]and[l[0]+l[-1]]+f(l[1:-1])or l

Try it online!

Same length:

f=lambda l:l[1:]and[l.pop(0)+l.pop()]+f(l)or l

A much shorter solution works for even-length lists (30 bytes)

lambda l:[x+l.pop()for x in l]

Try it online!

I'm still trying to find a short way to correct it for odd length.

05AB1E, 5 bytes

Code

2ä`R+

Uses the 05AB1E encoding. Try it online!

Explanation

2ä        # Split the list into two pieces
  `       # Flatten the stack
   R      # Reverse the second element from the list
    +     # Vectorized addition

Gaia, 7 bytes

e2÷ev+†

Explanation

e        Eval the input (push the list).
 2÷      Split it in half. The first half will be longer for an odd length.
   e     Dump the two halves on the stack.
    v    Reverse the second.
     +†  Element-wise addition. If the first half has an extra element, it is simply appended.

JavaScript, 75 71 bytes

a=>a.slice(0,n=a.length/2).map(b=>b+a[--z],z=n*2).concat(n%1?a[n|0]:[])

Try it online

Saved 2 bytes thanks to ETHproductions

Python 3, 70 bytes

lambda l:[l[i]+l[~i]for i in range(len(l)//2)]+len(l)%2*[l[len(l)//2]]

Try it online!

Python 3, 101 bytes

lambda l:[sum(x)for x in zip(l[:len(l)//2],l[int(len(l)/2+.5):][::-1])]+[[],[l[len(l)//2]]][len(l)%2]

Try it online!