[Question]
  [
Given a string, if it is even, break the string into 2 even parts, then reverse the parts to get the "reversencoded" string.
Example:
onomatopoeia -> tamonoaieopo
If the string is not of even length, then do not change the position of the middle character, and reverse the letters before and after the middle character.
Example:
pizza -> ipzaz
discord -> sidcdro
Limitations:
The input will not contain any other characters other than AlphaNumeric characters. i.e. No newlines/whitespaces.
General contest, shortest code in each language will be winning.
Good luck!
*btw: i made up the word reversencoded, i'm fairly sure such a form of "encryption" doesnt exist*
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ṚŒHZUZ
```
[Try it online!](https://tio.run/##y0rNyan8///hzllHJ3lEhUb9f7h7y@H2R01rIv//z8/Lz00syS/IT81M5CrIrKpK5ErJLE7OL0rhcnRydnF1c/eAMzwB "Jelly – Try It Online")
## Explanation
Consider the string `ABCDEFGHI`:
```
ṚŒHZUZ
Ṛ      reverse -> IHGFEDCBA
 ŒH    split into halves -> IHGFE
                            DCBA
   Z   transpose -> ID
                    HC
                    GB
                    FA
                    E
    U  reverse each row -> DI
                           CH
                           BG
                           AF
                           E
     Z transpose -> DCBAE
                    IHGF
       implicitly concatenate -> DCBAEIHGF
```
*I never thought the time would come when I'd outgolf Jonathan Allan in Jelly…*
[Answer]
# [Factor](https://factorcode.org/), ~~76~~ ~~72~~ 65 bytes
```
[ dup length 2 rem swap halves rot cut [ reverse ] tri@ 3append ]
```
[Try it online!](https://tio.run/##DcwxDsIwDEbhnVP8J2CADZZuiIUFMVUdosTQiDZ2HbcVRZw9ZH6f3tN5Yy2P@/V2OeFNmmjA6KxHpmmm5ClDlMw@ojEZphXn3bR@wYkrY2GKDhK3zSHE7FkDfqVFmAUDpVcdHaA0Iq9O0LthqUNlg58NbS0LaSZ0MI0Njk6EUkBXxqr35Q8 "Factor – Try It Online")
*-7 bytes thanks to @Bubbler!*
## Explanation:
It's a quotation (anonymous function) that takes a string from the data stack as input and leaves a string on the data stack as output. Assuming `"pizza"` is on the data stack when this quotation is called...
* `dup` Duplicate the object on top of the data stack
**Stack:** `"pizza" "pizza"`
* `length` Take the length
**Stack:** `"pizza" 5`
* `2` Push `2` to the stack
**Stack:** `"pizza" 5 2`
* `rem` The remainder of dividing second-from-top by top
**Stack:** `"pizza" 1`
* `swap` Swap the top two objects
**Stack:** `1 "pizza"`
* `halves` Cut a sequence in half. If the sequence has an odd number of elements, the extra element will be in the sequence that is on top of the stack. `halves` returns slices for efficiency.
**Stack:** `1 T{ slice f 0 2 "pizza" } T{ slice f 2 5 "pizza" }`
* `rot` Move the object third from the top to the top
**Stack:** `T{ slice f 0 2 "pizza" } T{ slice f 2 5 "pizza" } 1`
* `cut` Take a sequence and an index and split the sequence in two at that index. When given an index at either end of a sequence, an empty string will be one of the outputs. `cut` will "reify" the slice.
**Stack:** `T{ slice f 0 2 "pizza" } "z" "za"`
* `[ reverse ]` Push a quotation for `tri@` to use later
**Stack:** `T{ slice f 0 2 "pizza" } "z" "za" [ reverse ]`
* `tri@` Apply a quotation to three objects. In this case, reverse them.
**Stack:** `"ip" "z" "az"`
* `3append` Append three sequences
**Stack:** `"ipzaz"`
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 36 bytes
```
^((.)+?)(.)??((?<-2>.)+)$
$^$1$3$^$4
```
[Try it online!](https://tio.run/##K0otycxLNPyvquGe8D9OQ0NPU9teE0ja22to2NvoGtkBBTRVuFTiVAxVjIGkyf//@Xn5uYkl@QX5qZmJXAWZVVWJXCmZxcn5RSkA "Retina – Try It Online") Link includes test cases. Explanation:
```
^((.)+?)(.)??((?<-2>.)+)$
```
Match a minimal prefix, an optional centre character, and then a suffix of the same length as the prefix. The prefix and centre are lazy rather than greedy as that's shorter than checking that the group `$2` is properly balanced.
```
$^$1$3$^$4
```
Reverse the prefix and suffix.
[Answer]
# [R](https://www.r-project.org/), 86 bytes
(or [79 bytes](https://tio.run/##Tc5BCsIwEIXhu3SVoaMSQRel04tIFzGmGjCTkEkFe/m0oIirb/M/eLlm93JZHNt4c1SnmW3xkZUgE9uHyUoAA/Hh2O5PGIk7DTJfpWTP963y/c6qeIl9GHGD6OMQRkAPVUxKz7f6orsz/sZYqEl@WYw0OJEG/H8CdQU) with output as a vector of characters instead of a string)
```
function(s,n=nchar(s),m=n/2+.5,o=n:1)intToUtf8(utf8ToInt(s)[c(o[o<m],o[o==m],o[o>m])])
```
[Try it online!](https://tio.run/##Tc4xC8IwEIbh/9IpwUOJoEjx3N3rVDrUmGrA3oVcItg/HwM6uHzP8g1vLNG9XBRHlm8Oy5TJJs@kBAjJPsaoRMOMtNmu1jtgpNZoT6njS5oOKtfp@EypvnqruOfjPEAF8etpHvSgi4whPN/qh2n3IPkqKXq6Q8Im@GUZpYEJjYb/IF0@ "R – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
LHịJ‘œṖ⁸U
```
[Try it online!](https://tio.run/##y0rNyan8/9/H4@Hubq9HDTOOTn64c9qjxh2h/w@3a0b@/69UkFlVlaikowBhVCkBAA "Jelly – Try It Online")
Full program, due to Jelly's smash-printing
## How it works
```
LHịJ‘œṖ⁸U - Main link. Takes a string S on the left
L         - Length of S, L
 H        - L÷2
   J      - Indices of S; [1, 2, 3, ..., L]
  ị       - Index into;
             If L is even, this just returns L÷2
             If L is odd, this returns [(L-1)÷2, [(L+1)÷2]
    ‘     - Increment
       ⁸  - Yield S, to prevent œṖ hooking to U
     œṖ   - Partition S at the indices in the left
        U - Reverse each sublist
            Implicitly "smash" together (["ip", "z", "az"] -> "ipzaz") and print
```
[Answer]
# [J](http://jsoftware.com/), 25 22 bytes
```
[:;]<@|./.~#\*@-2%~1+#
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o62sY20cavT09eqUY7QcdI1U6wy1lf9rcnGlJmfkK6hnFlQlVqkr6FoppCmoF2RWVSWqQ2WKM1OSU4ryYXIpmcXJ@UUp6v8B "J – Try It Online")
## the idea
Consider `discord`. We solve in two steps:
* Create a mask like `_1 _1 _1 0 1 1 1`. For even number inputs, the mask will not contain 0.
* Use that mask to partition into groups, reversing each group.
## J details
Using discord as an example:
* `1+#` The length plus one, 8 in this case
* `2%~` Divided by 2, so now 4.
* `-` Subtracted elementwise from
* `#\` The range `1..<length>`
```
 _3 _2 _1 0 1 2 3
```
* `*@` Sign of each:
```
 _1 _1 _1 0 1 1 1
```
* `/.~` Use that as mask to group the input
* `<@|.` Reversing and boxing each group
```
┌───┬─┬───┐
│sid│c│dro│
└───┴─┴───┘
```
* `[:;` Raze
```
sidcdro
```
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 50 bytes
```
lambda x:x[(l:=len(x)//2)-1::-1]+x[l:-l]+x[:~l:-1]
```
[Try it online!](https://tio.run/##K6gsycjPM7YoKPqfZhvzPycxNyklUaHCqiJaI8fKNic1T6NCU1/fSFPX0MpK1zBWuyI6x0o3B0Rb1eWARP4XFGXmlWikaSgVZFZVJSppanLBRfLz8nMTS/IL8lMzQRL/AQ "Python 3.8 (pre-release) – Try It Online")
-8 bytes thanks to dingledooper
[Answer]
# JavaScript (ES6), ~~59~~ 58 bytes
*Saved 1 byte thanks to [@edc65](https://codegolf.stackexchange.com/users/21348/edc65)*
Expects an array of characters.
```
s=>s.map(c=>s[i*2]?p=s[i+++i]?c+p:p+c:q=c+q,i=p=q='')&&p+q
```
[Try it online!](https://tio.run/##bYvLCoMwEEX3/Qpx4aNpI3RZSP0QcTFMYpmizsRIF/n5NNBCN97V4XDuC94QcCPZrytblyaTgnkEvYA0mGGg823sxWRQStHYo5K7KLx7g8pfyIjxpq7bqhLlE/IaeHZ65mczNYPWuuSVF9hZ2BGUY9sWXVfssGQN5LI@HXyEYvzGv@UPSYR4FFsKyJv95zkOZNFunD4 "JavaScript (Node.js) – Try It Online")
### Commented
```
s =>                 // s[] = input string, as an array
  s.map(c =>         // for each character c in s[]:
    s[i * 2] ?       //   if s[i * 2] is defined, this is either the first
                     //   half of the string or the middle character of a
                     //   string of odd length:
      p =            //     update p:
        s[i++ + i] ? //       if s[i * 2 + 1] is defined, this is not the
                     //       middle character:
          c + p      //         prepend c to p
        :            //       else (middle character):
          p + c      //         append c to p
    :                //   else (2nd half of the string):
      q = c + q,     //     prepend c to q
    i = p = q = ''   //   start with p = q = '' and i zero'ish
  )                  // end of map()
  && p + q           // return p + q
```
[Answer]
# [R](https://www.r-project.org/), ~~81~~ 79 bytes
```
function(s,n=nchar(s),m=n/2+1)intToUtf8(utf8ToInt(s)[c(m:2-1,m[n>1&n%%2],n:m)])
```
[Try it online!](https://tio.run/##dY6xCoMwFEX3foZgTegrJQ6lBNK9u53EIcZEA82LJLFQfz516ODS5R4OZ7khB/3WIWpUftAimwVVsh5JBBSoJhlIpOAEXuoToxZT45/J3MiyTeMfmLbcKuJ4fWbgWryzI5Zl3QFyRzuao5zn14f8wPgV4tLHFCyOkEQx23WVsQAjGIX9E3rYG6lkrwZtxqn6Eyqavw "R – Try It Online")
*-2 bytes thanks to [@Dominic](https://codegolf.stackexchange.com/users/95126/dominic-van-essen)*  
*-2 bytes thanks to [@Giuseppe](https://codegolf.stackexchange.com/users/67312/giuseppe)*
Developed independently from [@Dominic's answer](https://codegolf.stackexchange.com/a/223762/55372), but some golfs adapted from there.
Abuses the fact that range operator `:` and extract operator `[` both cast their inputs to int.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~16~~ ~~13~~ 12 bytes
```
R2ä`?IgÉiÁ}?
```
[Try it online!](https://tio.run/##yy9OTMpM/f8/yOjwkgR7z/TDnZmHG2vt//8vyKyqSgQA "05AB1E – Try It Online")
```
R     reverse input
2ä    slice to 2 pieces, i.e. ["azz", "ip"]
`     dump pieces to stack
?     print last piece without newline
I     push input
g     length
É     is odd
iÁ}   if true rotate right by one
?     print without newline
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 42 bytes
```
^|$
¶
+`(.*¶)(.)(.*)(.)(¶.*)
$2$1$3$5$4
¶
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP65GhevQNi7tBA09rUPbNDX0gEgLTB3aBmRwqRipGKoYq5iqmICU/f@fn5efm1iSX5CfmpnIVZBZVZXIlZJZnJxflAIA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
^|$
¶
```
Wrap the input in a working area of three lines.
```
(.*¶)(.)(.*)(.)(¶.*)
$2$1$3$5$4
```
Extract the first and last characters of the input, building them up in reverse in the working area.
```
+`
```
Continue extracting characters until there is at most one left.
```
¶
```
Join the pieces back together.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ŒHṚU2¦FƲ⁺
```
A monadic Link accepting a list that yields a list.
**[Try it online!](https://tio.run/##ASAA3/9qZWxsef//xZJI4bmaVTLCpkbGsuKBuv///3Bpenphcw "Jelly – Try It Online")**
### How?
```
ŒHṚU2¦FƲ⁺ - Link: list, S
        ⁺ - repeat this twice - i.e. f(f(S)):
       Ʋ  -   last four links as a monad - f(x)
ŒH        -     split (x) into two halves (odd length x gives longer first half)
  Ṛ       -     reverse
    2¦    -     apply to second element:
   U      -       upend (reverses just 2nd element)
      F   -     flatten
```
---
Another 9 byter using the same method:
```
ŒHṪ;UFƲ$⁺
```
[Answer]
# [Red](http://www.red-lang.org), 81 bytes
```
func[s][rejoin[reverse take/part s(n: length? s)/ 2 take/part s n % 2 reverse s]]
```
[Try it online!](https://tio.run/##TUy7CgIxEOzzFUtA0EIOLK/Qf7ANKUKy8eJjN2yi4v18DB4HTjPDvARDO2MwVsWxxSd5U6wRvHKiTi@UglDdDYfspELZ0gh3pEudTlB2Axz@QyDYdGedFWtbZEHnJ3izBDAKOjQTP1zlzJicXqyc5nnVIRXf21pZkyVRBeM5f5YHvT9qiD/dz78 "Red – Try It Online")
# Using `parse`, 93 bytes
```
func[s][h:(n: length? s)/ 2 d: n % 2 b:[change copy t h skip(reverse t)]parse s[b d skip b]s]
```
[Try it online!](https://tio.run/##NY3BCgIhGITv@xSDEOweIujood6hq3hw9XeVSkWtaF/eNqM5fcwMM5lMu5ARcrC82UfQokjh@Bg4bhSW6s4o0wFHGI6A3QYzF9qpsBB0TG9UOJSrT2OmJ@VCqJNM6gtFzDA9wyyLbDZmUtrhFbOBGLCJxRDvqsYUySv2s5Jf1z8bX/TWZoMUKftQIfpnX2D7E4PtLGX7AA "Red – Try It Online")
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), 95 bytes
```
	M =LEN(SIZE(I =INPUT) / 2)
	I M . L ARB . C M . R RPOS(0)
	OUTPUT =REVERSE(L) C REVERSE(R)
END
```
[Try it online!](https://tio.run/##K87LT8rPMfn/n9NXwdbH1U8j2DPKVcNTwdbTLyA0RFNBX8FIk4vTU8FXQU/BR8ExyAlIO4N5QQpBAf7BGgZAaf/QEKBiBdsg1zDXoGBXDR9NoBoYJ0iTy9XP5f//gsyqqkQA "SNOBOL4 (CSNOBOL4) – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 21 bytes
```
++_<QK/lQ2*@QK%lQ2_>K
```
[Try it online!](https://tio.run/##K6gsyfj/X1s73ibQWz8n0EjLIdBbFUjH23n//6@UklmcnF@UogQA "Pyth – Try It Online")
```
Q        # input
K/lQ2    # Set K to len(Q)/2 (integer division)
_<QK     # Take first K elements and reverse them
*@QK%lQ2 # The element at index K taken len(Q) % 2 times
_>K      # Take last K elements and reverse them
++       # Concatenate them
```
*-2 bytes thanks to hakr14*
[Answer]
# [V (vim)](https://github.com/DJMcMayhem/V), 54 bytes
```
YpC<c-r>=strlen('<c-r>"')/2
<esc>DkA <esc>0@"li
<esc>$@"hi
<Esc>:%!rev
gJgJF x
```
[Try it online!](https://tio.run/##K/v/P7LA2SZZt8jOtrikKCc1T0MdzFNS19Q34rJJLU62c8l2VAAzDByUcjIhYioOShlApiuQaaWqWJRaxpXule7lplDx/39@Xn5uYkl@QX5qZuJ/3TIA "V (vim) – Try It Online")
The 'no whitespace' guarantee helped a lot with writing this solution.
## Explanation
```
YpC<c-r>=strlen('<c-r>"')/2
Yp                          copy input to new line
  C                         cut and open insert mode
   <c-r>=strlen('<c-r>"')/2 set the line to half of input length
                            call this k
<esc>DkA <esc>0@"li         
<esc>                       exit insert mode
     D                      delete the number k(and copy)
      k                     move to the input
       A <esc>              insert a space at the end
              0@"l          move right k times from the start
                  i         insert a newline
<esc>$@"hi
     $@"hi                  do the same thing, except from the right
<esc>:%!rev                 reverse all lines
gJgJF x                     
gJgJ                        join the three lines
    F                       navigate to the previous space
      x                     delete it
```
[Answer]
# [Julia](http://julialang.org/), ~~50~~ 48 bytes
```
a->a[(d=(l=end)÷2):-1:1]a[d+1:l-d]a[l:-1:l-d+1]
```
[Try it online!](https://tio.run/##JctBCsMgEIXhvacYXCnBgl0K5iLiYqgGLNMo1UIaeq8eoAezpt19/I93fVBCvfXFdlQzOhGsIBvXID/vszRKG@3RhUkbUmGIjjQ4ad9brK2CBc45y2u@Ycslx4SspH1HFlK95HsYK7xmqIVSY0cshE/h4P9eTuIHCV72Lw "Julia 1.0 – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `s`, 36 [bitsv1](https://github.com/Vyxal/Vyncode/blob/main/README.md), 4.5 bytes
```
Ṙ½∩R∩
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=1#WyJ+cz0iLCIiLCLhuZjCveKIqVLiiKkiLCIiLCIhKFxcdyspIC0+IChcXHcrKS5cbm9ub21hdG9wb2VpYSAtPiB0YW1vbm9haWVvcG9cbnBpenphIC0+IGlwemF6XG5kaXNjb3JkIC0+IHNpZGNkcm8iXQ==)
Porting Jelly is always the best way to do code-golf. Can't believe transpose used to be 2 bytes
## Explained
```
Ṙ½∩R∩
Ṙ         # reversed(input)
 ½        # ↑ split into two halves
  ∩       # transpose ↑
   R      # reverse each row in ↑ (when neither argument is a function, reduce performs vectorised reverse instead)
    ∩     # transpose ↑ and sum using s flag
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 15 bytes
```
⭆⪪θ⊘⊕Ｌθ⭆⪪ι⊘Ｌθ⮌λ
```
[Try it online!](https://tio.run/##XctBCoAwDATAr/QYob7ADygoiL6gtEELsWoM/X6sFxH3snvY8atjvztSHTkmgVlKLYM7YD4oCpzWtI4yBuiSZ9wwSdk9pkVWOKsSa/4mvubzs2bCjHwh0KMa1RAvv3PQOtMN "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
  θ             Input string
 ⪪              Split into pieces of length
      θ         Input string
     Ｌ          Length
    ⊕           Incremented
   ⊘            Halved
⭆               Map over pieces and join
         ι      Current piece
        ⪪       Split into pieces of length
            θ   Input string
           Ｌ    Length
          ⊘     Halved
       ⭆        Map over pieces and join
              λ Current piece
             ⮌  Reversed
                Implicitly print
```
[Answer]
# [Python 3.8](https://docs.python.org/3.8/), ~~63~~ 62 bytes
```
lambda s:s[(l:=len(s))//2-1::-1]+s[l//2]*(l&1)+s[:-~l//2-1:-1]
```
[Try it online!](https://tio.run/##NY/RboMgFEDf/YobHyZsmsa2yRYS9yO2DwiXlgyFAEs2jft1B67j6Zxcci6473i30@nN@U11l83wcZAcAgs9MawzOJFA6eFwbFrGmvb6EnqT7PpMzFNLk7Hmx/yN03SLGGKADkjJByFRlTU86JbRTnbk0TqLmmd3ep53kDoI62VJC/xyKCLKPSIGrlDmC4nkTWHGyMfU4RpTJ7t2M58zBC2F9DZFxB3FB/rcqC6fx9ezqGrYqT1VtFDWQ6wR9ASzdmR/dA3/mykrIJ38DUUi3cV5PUWiqiWu0LzDElZYHkt67LpwXSu6/QI "Python 3.8 (pre-release) – Try It Online")
[Answer]
# [05AB1E (legacy)](https://github.com/Adriandmen/05AB1E/tree/fb4a2ce2bce6660e1a680a74dd61b72c945e6c3b), 9 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
g;¤Ā‚Ć£íJ
```
[Try it online](https://tio.run/##MzBNTDJM/f8/3frQkiMNjxpmHWk7tPjwWq///w2NjE1MAQ) or [verify all test cases](https://tio.run/##MzBNTDJM/V9Waa@k8KhtkoKSfaXL/3TrQ0uONDxqmHWk7dDiw2u9/uv8j1bKz8vPTSzJL8hPzUxU0lEqyKyqAtEpmcXJ@UUpQJahkbGJqVIsAA).
**Explanation:**
```
g          # Get the length of the (implicit) input
 ;         # Halve it
  ¤        # Get the last digit (without popping), which is either 0 or 5
   Ā       # Truthify it, converting the 5 to 1 (0 remains 0)
    ‚      # Pair the two values together
     Ć     # Enclose it; appending the leading halve length as trailing item
      £    # Split the (implicit) input into parts of that size (which truncates the
           # decimals)
       í   # Reverse each part
        J  # Join the parts back together to a string
           # (after which the result is output implicitly)
```
It uses the legacy version of 05AB1E, because in the new version the `¤` won't work on decimals and would require an explicit cast to string (so 10 bytes instead: [`g;§¤Ā‚Ć£íJ`](https://tio.run/##ASEA3v9vc2FiaWX//2c7wqfCpMSA4oCaxIbCo8OtSv//MTIzNDU)).
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 13 bytes
Splits the input (e.g. `"pizza"` or `"pizzas"`) into an array based on indexes (e.g. `["pi", "z", "za"]` or `["piz", "zas"]`), then maps each item through string reverse and joins again.
```
üÏgUÊ*½-½ÃmÔ¬
ü             // Group input characters by mapped value where
 Ï            // depending on whether the index is smaller, equal or larger than
   UÊ*½-½     // input's length in half minus half,
  g           // the value is -1, 0, or 1.
         Ã    // Then,
          mÔ¬ // map each item through reverse and join to a string.
```
[Try it here.](https://ethproductions.github.io/japt/?v=1.4.6&code=/M9nVcoqvS29w23UrA==&input=InBpenphIg==)
[Answer]
# [Scala](http://www.scala-lang.org/), 145 bytes
Golfed version, [try it online!](https://tio.run/##VYxBDoIwEEX3nmJCYtIGg8pS0wVn8AQDDLSmtA2txEA4e0UkRrfvvf99hRqjLe9UBSiAnoFM7aFwDqZYUwMNw8st9Mq0XEwDapACM02mDfKYX9@gE0wt1Qb3uRBnjlklsS8CkzwL9rMH0p6ShF8x84/Sr4ydDkvR00C9pxR@jUy77fIbzBHALTJowxqWODWOmHC@@6PW2A6DdZbUKuf4Ag)
```
def f(a:String)={val h=a.length/2;val m=(if(a.length%2==1)a.charAt(h).toString else"");a.substring(0,h).reverse+ a.substring(h+m.length).reverse}
```
Ungolfed version
```
object A extends App {
  val f:String=>String=input=>{
   val halfLength = input.length / 2
   val middleChar = if (input.length % 2 == 1) input.charAt(halfLength).toString else ""
   val firstHalfReversed = input.substring(0, halfLength).reverse
   val secondHalfReversed = input.substring(halfLength + middleChar.length).reverse
   firstHalfReversed + middleChar + secondHalfReversed
  }
  println(f("pizza"))
  println(f("onomatopoeia"))
}
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 102 ~~106~~ bytes
> 
> -4 bytes thanks to @ceilingcat !
> 
> 
> 
For each character we calculate the index of the character it should switch place with.  
  
Incidentally this calculation also gives `-1` for the middle character of an odd-length String, which is quite useful!
```
s->{var r="";for(int j,i=0,l=s.length();i<l;r+=s.charAt(j<0?i-1:j))j=l-(i++*2/l*2-1)*~l/2-i;return r;}
```
[Try it online!](https://tio.run/##dZDPUsIwEMbvPsVOTmlLS1tQ0Fod73ry6HhY2wCp6R@TlFEcvHnzEfTleBEMEBhhZE@Zb3/59tstcIp@kT8vm/ZJ8AwygUrBHfIK3k9OAHilmRxhxuDWCGDqXktejWFE7UM5idHnK1hp1MbjFgSkS@VfvU9RgkwJSUa1pMYKig5Pw45IVSBYNdYT6iT8UiTSM0o2QXmjaXEZXnM/uigcp0iFT7nnuXFXuLEfOe6H6MY@TyTTraxAJvNlshpsw9v505rnwKYothEblFh2tsnZa8MyzXJnfyHJVCs0pCCCEV3/WC9m@m9KszKoWx00htSionTrEbCXFoWim8/ONVl8f5ILsvj5Io5HgHi2sTvRP0lLc2yb9OERUI7VNtl6ByB1VZeo66ZmHAl0gGgsjYacGY2AjWnhhs9mhrJlYN7McHZI5VxltczJjlI8z3K5ceu6R9be9wijuNc/PRsMifXoxVHYHw7OTg@n7chzsiH7K/T8KPo3fhTG/d6KcrubG86Xvw "Java (JDK) – Try It Online")
[Answer]
# [SAS](https://sas.com), 132 bytes
```
%let n=%eval(%length(&s)/2);data;s="&s";length a b$&n;a=s;b=reverse(s);s=cats(reverse(a),ifc(length(s)/2=&n,"",char(s,&n+1)),b);run;
```
Assuming you have macrovariable `s` containing the text:
```
%let s=abcXdef;
```
Execute ("ungolfed" for readability):
```
%let n = %eval(%length(&s)/2);
data;
 s = "&s";
 length a b $ &n;
 a = s;
 b = reverse(s);
 s = cats(reverse(a)
         ,ifc(length(s)/2 = &n, "", char(s, &n+1))
         ,b);
run;
```
to print out content of created dataset (named automatically `data<N>`) run:
```
proc print;
run;
```
[Answer]
# [ReRegex](https://github.com/TehFlaminTaco/ReRegex), 146 bytes
```
( *)@(.)/$2$1 @/@$/%/(\w)( *)( +) %\2(?! )/$2$3% $2$1/(.*?)(\w) ( +)%\3(.*)/!$1>$2!$4>/^(\w*?)( +)%\2(.*)/!$1>!$3>/!(\w*?)(\w)>/$2!$1>/!>//@#input
```
## Explained
```
( *)@(.)/$2$1 @/                    # Count characters. Add a space for every character in the string.
@$/%/                               # Once counting is done, move to dividing
(\w)( *)( +) %\2(?! )/$2$3% $2$1/   # Push character an space pairs over to the other side until it's roughly equal to the lefti n length
(.*?)(\w) ( +)%\3(.*)/!$1>$2!$4>/   # When they're roughly equal, split odd groups into !left>mid!right>
^(\w*?)( +)%\2(.*)/!$1>!$3>/        # Same as above but without the mid character.
!(\w*?)(\w)>/$2!$1>/                # Push the last character of a !> group right behind it, effectively reversing the string.
!>//                                # Clear up any emtpy !> groups
@#input                             # Format the input with a @ counter behind it.
```
[Try it online!](https://tio.run/##PctBCsIwEIXhq0xwAjMVOiRxneYgwY0N0o1KtOjtY6aUbt//vVpquZdfawQDJxpZ0KODJAnFCuUvayA4M9jsaTKwiWBBndA4TKwKlNgc@sBi0EX0Bi9Rrj0q2ao/qsEQxeyt36Ood32LIum0PF7rp7V5ed@edf4D "ReRegex – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
Ôñ@Ê*½-½ gY
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=1PFAyiq9Lb0gZ1k&input=InBpenphIg)
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), ~~8~~ 6.5 bytes (13 nibbles)
*Saved 1.5 bytes by porting [xigoi's Jelly solution](https://codegolf.stackexchange.com/a/223777/16766) like [lyxal did](https://codegolf.stackexchange.com/a/223813/16766)*
```
+`'.`'`\~\@\$
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m708LzMpKSe1eMGCpaUlaboWe7QVEtS5FPS4FMA0kIxRqFOIcQAyY1QgShbAqILMqqpECAcA)
### Explanation
```
+`'.`'`\~\@\$
          @    First line of stdin
         \     Reverse
      `\~      Split into two parts
    `'         Transpose
   .           Map this function to each string in that list:
           \$   Reverse it
 `'            Transpose
+              Concatenate together
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 274 bytes
```
class A{public static void main(String[]a){System.out.print(new StringBuilder(a[0].substring(0,a[0].length()/2)).reverse().toString()+(a[0].length()%2==1?a[0].charAt(a[0].length()/2):"")+new StringBuilder(a[0].substring((int)(a[0].length()/2D+.5D))).reverse().toString());}}
```
[Try it online!](https://tio.run/##hY7NCoJAEMdfRYRgBmszoUsRYfgGHsXDpEtt@cXuaKT47JvYqSA6Dfzm/3Wjjla3/G5tVpAxTjg07blQmWOYeDpdrXKnJFVBzFpVlyQlHOKnYVmKumXRTJChkg/n/T@1qsilBkr8VJj2bGYK/nIGhawufAVcB4hCy05qIwEF128zoAcfukVwOGyOM8qupEOG75id66L3tx6mkfjtjTyxjfDHENyPo7W2UX1PLw "Java (JDK) – Try It Online")
[Answer]
# [Lua](https://www.lua.org/), 69 bytes
```
s=...n=#s//2print((s:sub(-n)..s:sub(n+1,-n-1)..s:sub(1,n)):reverse())
```
[Try it online!](https://tio.run/##PcgxCsAgDADAx3RJqEbsKPgYCw5Cm4jRfj8dCt2Ou1Yx00xEnDcN4eij8QTQpOsEz0j0kffoPPv4R3SMmEZ96tAKiGYmLHeZ0qW28gI "Lua – Try It Online")
]