[Question]
  [
There are a bunch of different casing conventions, like `camelCase`, `PascalCase`, `snake_case` etc. It's annoying juggling all of these, so instead of choosing one like a sensible person, why not cursedly mix all of them together?
Your challenge is to, given a list of words (only containing lowercase letters), convert them to backwardS\_hybriD-snakE\_kebaB-cameL\_case. To do so:
* The words are joined by alternating underscores and hyphens, starting with underscores.
* Capitalise the last letter of every word but the last.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest wins!
## Testcases
These are formatted as space-separated words
```
hello world -> hellO_world
beans -> beans
one two three four -> onE_twO-threE_four
backwards hybrid snake kebab camel case -> backwardS_hybriD-snakE_kebaB-cameL_case
test three words -> tesT_threE-words
o n e l e t t e r -> O_N-E_L-E_T-T_E-r
```
  
[Answer]
# [Python](https://www.python.org), 72 bytes
```
lambda s:re.sub(" (.*?) ",r"_\1-",s+"x ")[::-1].title()[:1:-1]
import re
```
[Attempt This Online!](https://ato.pxeger.com/run?1=VY7BCoJAGITvPsXPnnZLBW8hRNfeISN29RfFdVf-XTGhN-kiRL1Tb5NhBF5mmA9mmPurG31lzfQo99mz92W0ex-1bFUhwaWEsesVZ8DjzUEAC4ldsiRioduyKzBxStMoOce-9hr5nJJvDOq2s-SB8Ld366g2npecVai1hcGSLpgQwZ8rlMatiDUIfrDgK0KE0va0Lsi8GSQVDqpRUV2AM7JBaFBJBblsUc_qcO4sH6Zp8Q8)
#### How?
Uses regular expression to substitute pairs of spaces. To make sure every space is handled the auxiliary string "x " is appended. The result is reversed, `title` cased and reversed back. The auxiliary string (which has absorbed one unwanted `title` casing) is removed.
[Answer]
# JavaScript (ES6), 50 bytes
Expects and returns a list of ASCII codes.
```
a=>a.map((c,i)=>a[i+1]^32?c^32?c:C^=114:c^32,C=45)
```
[Try it online!](https://tio.run/##NU/BboMwDL3zFRanoHXR2LpLKzpNaF@wI6KSCaYwQlw52dC@nqWUWfKTn/38LH/hD3ojwzU8Om5p6YoFixPqCa9Kmd2QRVIND3l9fnl@MyscynOR5/vDje3KYv@aLccqAUh7spZhZrFturs1GkLn7yU7gjAzhF6IoONv2SRoxhml9dD/NjK04B2OBCM12IDBiWxET3dxIB82h3il/bcGBwQ2ZhxGlDSpE92xfKDplYfiBIadZ0va8kV9BhncRXfCU9mjlPFrpbXuVBXR1@vnZl3SZpu/B/WUrbH8AQ "JavaScript (Node.js) – Try It Online")
### Commented
```
a =>              // a[] = list of ASCII codes
a.map((c, i) =>   // for each value c at position i in a[]:
  a[i + 1] ^ 32 ? //   if the next character is not a space:
    c ^ 32 ?      //     if the current character is not a space:
      c           //       leave it unchanged
    :             //     else:
      C ^= 114    //       make C switch between '-' and '_' and use it
  :               //   else:
    c ^ 32,       //     inverse the case of the current character
  C = 45          //   start with C = 45 (i.e. '-')
)                 // end of map()
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 13 bytes
```
Y`l  `L\_-`. 
```
[Try it online!](https://tio.run/##DcQxCkIxEAXAPqd4jWCj4ClsvIAgmN2fJ/lkTWATCZ4@OsU4x17lsg7Ha1z3aEC8PZ6neMZamWYNs7mloJTaQ6vEmA0jO4lX@3hQ2coUTx35q74n9CqFKFRRbPKm/e/8AQ "Retina – Try It Online") Link includes test cases. Explanation: Cyclically transliterates each space and the lower case letter before it. Since the two transliteration strings are the same length and the lower case letters appear exactly once each (via the shorthand `l`) they are simply transliterated to the upper case letters (`L`), however, there are two spaces in the transliteration string so they get alternately transliterated to `_` (which needs to be escaped in a transliteration) and `-` (which fortunately doesn't need to be escaped at the end of a string.)
The best I could do in [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d) was 23 bytes:
```
T`l `L\_`. 
(_.+?)_
$1-
```
[Try it online!](https://tio.run/##DcRBCgIxDADAe16Rg4cVccEX@AGPHoU22Wbp0thAWim@vjqHcelHpTmfUTE@XiGuCEtYL/dzgNPtOmcWVcNhrglYqDawKtiHYc8ugrt9HJi2MshTw/xlPxK2SkWwCBPjRm/R/01@ "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation: Since Retina doesn't have cyclic transliteration I just transliterate all of the spaces to `_`s and then fix up alternate `_`s to `-`s afterwards (which has to be done longhand as Retina 0.8.2 doesn't have step limits either).
[Answer]
# JavaScript, 52 bytes
-3 bytes by emanresu A; -2 bytes by Arnauld.
```
s=>s.replace(/. /g,c=>c[0].toUpperCase()+'-_'[s^=1])
```
[Try it online!](https://tio.run/##bcu/DoIwEIDx3ae4sNBGAZ1NWXwGJ4LmKMcfqb2mhxKfHnU1Lt/yy3fDJ4qNY5gzzy2tnVnFlJJHCg4tqSKHot9ZU9pqX@czn0OgeEIhpbdpdk0ruZhDrVfLXthR7rhXnUoGco5h4ejaROvj5ocbQi//gD3BvDDMQySCjh/x7452WjC2AsOriWML4nEimKjBBizeyX0q9F3XNw "JavaScript (Node.js) – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `s`, 12 bytes
```
ṫ$RǐR₅‛_-ẎYp
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJzIiwiIiwi4bmrJFLHkFLigoXigJtfLeG6jllwIiwiIiwiW1wiYmFja3dhcmRzXCIsXCJoeWJyaWRcIixcInNuYWtlXCIsXCJrZWJhYlwiLFwiY2FtZWxcIixcImNhc2VcIl0iXQ==)
-5 bytes thanks to emanresuA
## How?
```
ṫ$RǐR₅‛_-ẎYp
ṫ            # Tail extract, push a[:-1] and a[-1]
 $           # Swap
  R          # Reverse each
   ǐ         # Capitalize first letter of each
    R        # Reverse each
     ₅       # Push length without popping
      ‛_-    # Push "_-"
         Ẏ   # Extend this string to the length
          Y  # Interleave the list of words and each character of this string together
           p # Append the last item of the input (pushed earlier by tail extract) to this list
             # s flag joins this list to a string
```
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 25 bytes
Anonymous tacit prefix function. Takes list of words.
```
1⌊⍢⊃⍤↓⍢⌽∘∊⌈⍢⊃⍢⌽¨,¨'_-'⍴⍨≢
```
[Try it online!](https://tio.run/##NYq9CsIwFIV3n8LtLnYQH8FFV3WXxNxaaWwkrVRXhVJLI4oIzuLQQXBxdemj3BepieBy/r7DVtITWybV3MNNgpFA0TRdKgsydyr2ZB6UXVwuP5TfKC@ozP/IjXXVqSuYekDmTaaiw73xKTuROf4uTzvXrx5lZzpex6O@1clgOG58CFBKBW1IlZYCWn6Hih1wZFFsC6gILUtS90gCja75aq0d42wWpkyL2G7BluuFsCGOWOhOIXLGrc/YEuXPY4Qv "APL (Dyalog Extended) – Try It Online")
`≢` tally of words
`'_-'⍴⍨` use that to cyclically reshape this string
…`,¨` concatenate each of those to each of the following:
 …`¨` on each word:
  …`⍢⌽` while reversed (reverse back again when done):
   …`⍢⊃` while the first character is extracted (put it back again when done):
    `⌈` uppercase
…`∘∊` **e**nlist (flatten), and then:
 …`⍢⌽` while reversed (reverse back again when done):
  `1`…`⍤↓` drop the first character, and then:
   …`⍢⊃` while the first character is extracted (put it back again when done):
    `⌊` lowercase
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 16 bytes
```
ts.e+@"-_"k_r_b3
```
[Try it online!](https://tio.run/##K6gsyfj/v6RYL1XbQUk3Xik7vig@yfj//2il/LxUJR0FpZLyfDCVUZQK5qfllxYpxQIA "Pyth – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 13 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
í™í`l)„_-ÞøS¨
```
Input as a list of words; output as a list of characters.
[Try it online](https://tio.run/##yy9OTMpM/f//8NpHLYsOr03I0XzUMC9e9/C8wzuCD6347/U/WikpMTm7PLEopVhJRymjMqkoMwXIKM5LzE4F0tmpSYlJQDo5MTc1B0wXpyrFAgA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/w2sftSw6vDYhR/NRw7x43cPzDu8IPrTiv5fO/@hopYzUnJx8JR2l8vyinBSlWJ1opaTUxLxiMCs/LxUoU1IOki/JKEoF8dLyS4sgyhKTs8sTi1KKgYIZlUlFmSlARnFeYjZIVXZqUmISkE5OzE3NAdPFqUqxsQA).
**Explanation:**
```
í             # Reverse each word in the (implicit) input-list
 ™            # Titlecase each reversed word
  í           # Reverse each back
   `          # Pop the list, and push all words separated to the stack
    l         # Lowercase the last/top one
     )        # Wrap the stack back into a list
      „_-     # Push string "_-"
         Þ    # Cycle it indefinitely: ["_","-","_","-","_","-",...]
          ø   # Create pairs of the two lists, ignoring trailing items of the
              # longer (in this case infinite) list
           S  # Convert this list of pairs to a flattened list of characters
            ¨ # Remove the trailing "_"/"-"
              # (after which the result is output implicitly)
```
[Answer]
# [Python](https://www.python.org), ~~86~~ 80 bytes
```
lambda s,i=0:"".join("_-"[i:=~i]+w.title()for w in s[::-1].split())[:1:-1]+s[-1]
```
[Attempt This Online!](https://ato.pxeger.com/run?1=VY5BCsIwFET3nuKTVYK26E4CvYP7KpLYH_ptTEoSCYJ4ETcF0Tt5GyuK4GaGeTDDXB_9KbXeDTdTre_HZIrlc2XVQTcK4oyquWSs3HtynG0LVpOsLrSZ5jJRssiF8QEykINYS1ksNmXsLSUuRC0X7zyN9ajf3XMfyCVuOGvRWg_ZB9swISY_rlG5-Ee8Q0jZQ2oDIhh_DP8FteuyCk2E9qQDNRCd6hA61ErDTh3Qjhpx7Hw-DMPHXw)
-6 bytes thanks to @xnor
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 24 bytes
```
⭆θ⎇⁼ §θ⊕κ↥ι⎇⁼ ι§_-№…θκ ι
```
[Try it online!](https://tio.run/##bY1BCsIwEEX3nmLoKoH2BK6kuOhCENS1TJLBhqRpO2nVnj4mgjtXA3/@f0/3yHpEn9KZbVjEZcnnccJJzDVciQPyJo7zij6KCqoaDksXDL3LuwuaaaCwkBFOSlnDbZqINUYSVv6fl/yHqO5NTtpxzd52057afvx6XS7ldiHazJX7lBRq90I2EfpNsTUQAzoCRwoVaBzIQ/HuUvP0Hw "Charcoal – Try It Online") Link is to verbose version of code. Explanation: Similar approach to @Arnauld's JavaScript answer.
```
 θ                          Input string
⭆                           Map over characters and join
  ⎇⁼ §θ⊕κ                   If next character is a space then
         ↥ι                 Current character uppercased
           ⎇⁼ ι             Else if current character is a space then
               §_-          Literal string `_-` cyclically indexed by
                  №…θκ      Number of spaces in current prefix
                       ι    Else current character
                            Implicitly print
```
I also tried an approach based on splitting and joining but I wasn't able to get it below 26 bytes.
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 19 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
mxδmxhû_-*▒^\£<─~;!
```
Input as a list of words.
[Try it online.](https://tio.run/##y00syUjPz0n7/z@34tyW3IqMw7vjdbUeTZsUF3Nosc2jKQ111or//0crZaTm5OQr6SiV5xflpCjFckUrJaUm5hWDWfl5qUCZknKQfElGUSqIl5ZfWgRRlpicXZ5YlFIMFMyoTCrKTAEyivMSs0GqslOTEpOAdHJibmoOmC5OBesqSS0uQTINaCvQgFgA)
**Explanation:**
```
mx                  # Reverse each words in the (implicit) input-list
  δ                 # Titlecase each word
   mx               # Reverse each word back
     h              # Push the length of the list (without popping)
      û_-           # Push string "_-"
         *          # Repeat it the length amount of times
          ▒         # Convert it to a list ["_","-","_","-",...]
           ^        # Zip the two lists together, creating pairs
                    # (including trailing ["_"],["-"] items) 
            \       # Swap to get the input-list again
             £      # Pop and push its length
              <     # Only leave that many items (to only keep the pairs, and
                    # removing the trailing ["_"],["-"] items)
               ─    # Flatten this list of pairs
                ~   # Dump all strings separated to the stack
                 ;  # Discard the top ("_"/"-") one
                  ! # Lowercase the last/top word
                    # (implicitly join and output the entire stack)
```
[Answer]
# [brev](https://idiomdrottning.org/brev), ~~161~~ 150 bytes
```
(fn(strse x (: word(neg-look-ahead eos))(as-list(fn `(,@(butlast x) ,(char-upcase(last x)))))(: ($ word)" "($ word)" ")(conc(m 1)"_"(m 2)"-")'" ""_"))
```
325 with white space and test cases added:
```
(map
 (fn (strse x (: word (neg-look-ahead eos))
            (as-list (fn `(,@(butlast x) ,(char-upcase (last x)))))
        (: ($ word) " " ($ word) " ")
        (conc (m 1) "_" (m 2) "-")
        '" " "_"))
 '("hello world"
   "beans"
   "one two three four"
   "backwards hybrid snake kebab camel case"
   "test three words"
   "o n e l e t t e r"))
```
[Answer]
## [Python 3](https://docs.python.org/3/), 165 bytes
This is my first time having a go at this, so my answer is not gonna be great, but I found this really fun
```
lambda w:"".join([b if not i%2 else b[1:-1] for i,b in enumerate("_/-".join([s[::-1].title()[::-1] for s in w[:-1]]+[w[-1]]).split("/"))])+w[-1][::-1][:(len(w)+1)%2]
```
[Answer]
# [QuadR](https://github.com/abrudz/QuadRS) `2g`, ~~37~~ ~~30~~ 29 bytes
Takes space-separated words.
```
(\S) 
_(.*)(\S)_
\u1_
_\1\u2-
```
[Try it online!](https://tio.run/##FcbBCsMgDADQe74ix3awQfsruwqS1LQOnbJYkX59tl0e79MpqNnknjOCnx63@V8Pri8evFtcX@9mUXKuOKrmACxUGtQieI6KZ1QR3GtXYNrSIA0N48X6CtgKJcEkTIwbvSX/bGLr8QU "QuadR – Try It Online")
PCRE **R**eplace as follows, `2` times, with non-`g`reedy patterns:
| Target | Replacement |
| --- | --- |
| `(\S)`  non-space followed by space | `\u1_` uppercased non-space followed by underscore |
| `(.*?)(\S)_` any run of characters followed by a non-space and an underscore | `_\1\u2-` an underscore, the run, the uppercased non-space, an underscore |
 
[Answer]
# [Factor](https://factorcode.org/), ~~89 84~~ 75 bytes
```
[ unclip [ odd? "-""_"? rot 1 cut* >upper append -rot glue ] reduce-index ]
```
[Try it online!](https://tio.run/##VY5Ba8MwDIXv@RWPHAs57LrCehy77DJ2KmUottqYOLIj26Sj9LdnLoyRCfRA0pM@ncnkoOvnx9v76zMoGeeQonc5O7kg8VxYDCdMlAeMrMIeLmBesG@aW4Ma83LDwN4HLEG9xf2v2zNJ2tRBGHkJyIMy4xyKbs1kxoXUJgzfvTqLJDRyZfbUw9BUwYYSbzYyp/x7q5LtPxIEDF@zOqo@QPdmPaKI8S7iiGDtAW3Xtl/tARoynmBK3uGlxMgKqioW3WNy8YVxgrIthjsnlq841VtRneQ6MGGKoX7GZIb1Bw "Factor – Try It Online")
[Answer]
# [Zsh](https://www.zsh.org/), 61 bytes
```
g()<<<${${4+${3%?}${3[-1]:u}$1`g $2 $1 ${@:4}`}:-$3}
g _ - $@
```
[Try it online!](https://tio.run/##FYrBCgIhFEX3fsVdvEAJFzazkoHmPyKagqcThILjFCR@uxmXczbnfre1Oalk81JN00SFynikMhzOtfuizdXulcziQSeQAZXZjnWpVtNQhccNGjQ3JYRDDIz8ichrYoaLe4J7vrmXB9/D9n8ggPHq5D5Gaj8 "Zsh – Try It Online")
Recursive solution:
```
g() # define function g (braces optional since body is one line)
    <<<${${4+${3%?}${3[-1]:u}$1`g $2 $1 ${@:4}`}:-$3}
#        ${4+                                  }      # if $4 is set, substitute
#            ${3%?}                                   #   $3, remove last character
#                  ${3[-1]:u}                         #   upper last character of $3
#                            $1                       #   $1 (either _ or -)
#                              `g $2 $1 ${@:4}`       #   recurse, swapping _ and -
#      ${${                                   }:-$3}  # else substitute $3 unchanged
#   <<<                                               # print
g _ - $@   # seed initial arguments
```
[Answer]
# [Python 3](https://docs.python.org/3/), 95 bytes
Honestly not a great submission, but I can't figure out a way to make it any smaller with this approach.
```
lambda l:''.join('-_'[i%2]+w[:-1]+(w[-1].upper(),w[-1])[i>len(l)-2]for i,w in enumerate(l))[1:]
```
[Try it online!](https://tio.run/##JcntCoMgGIbhUxFhqPQBtX/BdiJOxmu9kUtNrJCO3tX267ke7nBs0@LveXy8sgWnByC2Y6z@LMZzVr2ZNLdWFUl2VaMKnuQ59R4CRi7K3xPSPC16bkXVqnGJxJSJGE/Q7w4jbHgWIZtO5RCN3/jIJdXQzwnisNKS0OnQ0QyXVg8zXphRg77Qg0P7x4pUCZG/ "Python 3 – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/) + `-p055`, 26 bytes
```
s!(.) !uc$1.($|--?$/:_)!eg
```
[Try it online!](https://dom111.github.io/code-sandbox/#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoicyEoLikgIXVjJDEuKCR8LS0/JC86XykhZWciLCJhcmdzIjoiLXAwNTUiLCJpbnB1dCI6Im8gbiBlIGwgZSB0IHQgZSByIn0=)
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~109~~ 91 bytes
*-18 bytes thanks to [@ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)*
```
main(c,v)char**v;{for(;1[++v];c=!c)strlen(*v)[*v-1]-=32,printf(c?"%s_":"%s-",*v);puts(*v);}
```
[Try it online!](https://tio.run/##FcpBCoMwEADAtzRQSGJysL11ER8iUmRJqtAmsonbQ@nbV73MadC/EEU@05I0OjY4T2Qtwy9m0tAOTcMjYHdBUyq9Q9KWzWDZt6Pv7je30pJq1Nira3mqx6FX7iiwbrWcF/4iklOQ@s1SZwpBYt5oBw "C (gcc) – Try It Online")
[Answer]
# [><>](https://esolangs.org/wiki/Fish), ~~32~~ 30 bytes
```
55*ii:48*=?\$o30.
-{:0$-}"F"+\
```
[Try it online](https://tio.run/##S8sszvj/39RUKzPTysRCy9Y@RiXf2ECPS7faykBFt1bJTUk75v//ktTiEoWSjKLUVIXy/KKUYgA)
**Explanation**
```
55*i               # init stack with 25 and first input
    i:48*=?\       # if next input is 32, move to row 2
            $o30.  # else print previous input and jump to next input handling
-                  # subtract 32 from previous input (switch to uppercase)
 {:0$-}            # get the 25 from bottom of stack and negate a copy for next iteration
       "F"+        # add "F" to get either "-" or "_" depending on sign of the 25
           \       # move back to row 1 to print
```
[Answer]
# BQN, 30 bytes
```
1↓·∾≠⊸⥊⟜"-_"∾¨-⟜32⌾⊏⌾⌽¨⌾(¯1⊸↓)
```
[Try it here!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAgMeKGk8K34oi+4omg4oq44qWK4p+cIi1fIuKIvsKoLeKfnDMy4oy+4oqP4oy+4oy9wqjijL4owq8x4oq44oaTKQoK4oCiU2hvd+KImEbCqCDin6gKImhlbGxvIuKAvyJ3b3JsZCIK4ouIImJlYW5zIgoib25lIuKAvyJ0d28i4oC/InRocmVlIuKAvyJmb3VyIgoiYmFja3dhcmRzIuKAvyJoeWJyaWQi4oC/InNuYWtlIuKAvyJrZWJhYiLigL8iY2FtZWwi4oC/ImNhc2UiCiJ0ZXN0IuKAvyJ0aHJlZSLigL8id29yZHMiCiJvIuKAvyJuIuKAvyJlIuKAvyJsIuKAvyJlIuKAvyJ0IuKAvyJ0IuKAvyJlIuKAvyJyIgrin6kKQA==)
## Explanation
* `...¨⌾(¯1⊸↓)` for each non-last word of the input...
	+ `-⟜32⌾⊏⌾⌽` uppercase last letter (literally by reversing and subtracting 32 from the first char)
* `≠⊸⥊⟜"-_"∾¨` couple each word with alternations of `-` and `_`
* `1↓·∾` join and drop first character
[Answer]
# [sed](https://www.gnu.org/software/sed/) w/ -E flag, 43 bytes
```
s/(.) /\U\1_/g
s/([^_]*_){2}/\0-/g
s/_-/-/g
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724ODVlWbSSrqtS7IKlpSVpuhY3tYv1NfQ0FfRjQmMM4_XTuYDc6Lj4WK14zWqjWv0YA12wWLyuPpAB0QLVueCmelJicnZ5YlFKsUJGZVJRZopCcV5idqpCdmpSYpJCcmJuag6QLE6FqAcA)
[Answer]
# [Ly](https://github.com/LyricLy/Ly), ~~25~~ 37 bytes
```
i0"_-"rsp[' =:' *lf-o[Ifprfr0]psp]>lo
```
[Try it online!](https://tio.run/##y6n8/z/TQCleV6mouCBaXcHWSl1BKydNNz/aM62gKK3IILaguCDWLif////8vFSFkvJ8hZKMotRUhbT80iIA "Ly – Try It Online")
Revised code... I didn't read the rule saying space has to be translated to `-` and `_` alternating.
```
i                                     - read input as codepoints
 0"_-"                                - push "0" and delimiters
      r                               - reverse stack
       sp                             - save last and delete
         [                      p]    - loop over the 2-N chars
          ' =                         - push 0|1 from comparing curr char to " "
             :                        - duplicate result
              ' *                     - multiply result w/ " " (32)            
                 lf                   - pull prev char, flip top stack entries
                   -                  - capitalizes if the curr char is " "
                    o                 - write out char codepoint as a char
                     [      0]p       - if/then, true if " " is curr char
                      I               - copy second to bottom stack entry                fp             - pull " " forward, delete
                         rfr          - reverse bottom two entries
                               s      - stash "_" or "-"
                                  >   - switch stacks
                                   lo - load last char and print
```
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), 154 bytes
```
filter f([char[]]$r){$s="_","-"
($r|%{[string]$c=$_
if(" "-eq$r[$i+1]){$c.ToUpper()}elseif(" "-eq$_){$s[$x+0]
$x=($x+1)%2}else{$c.ToLower()}$i++})-join''}
```
[Try it online!](https://tio.run/##RU5BboMwELzzipXlKEaUqumdH/TYnBBCxqyLi2uTtStSpbydGhKphx3NamdmZ/IzUhjQ2lJ5wnXVxkYk0KJWg6S6aTjlNx4q1rInVrJMcPo93OoQybiPhquKt5nRggEr8cKp5qY4Ncmhnt/9eZqQRL6gDfivabe8ml@Llybj10okdsoPr7vq7nvbSiVfyiqWvPz0xh2Py6qBbUU9zJ5sz7K0dyhd2Jl3CHH2EAdCBO2/6S6Qapwl9QGGn45MD8HJEWHETnag5BfahAF3bcQQH/70oX/kggMEmybdEhJb/wA "PowerShell Core – Try It Online")
Ungolfed:
```
filter f (
    [char[]]$r                     # coerce input string to character array
) {
    $s = "_","-"                   # initialize space array to replace " " with "_" and "-"
    (                              # () needed for -join '' 
        $r | ForEach-Object{
            [string]$c=$_          # [char] lacks .ToUpper(), .ToLower() - coerce back to [string] 
            if(" " -eq $r[$i+1]){  # if next character in array is a space
                $c.ToUpper()       # RETURN uppercase
            }
            elseif(" " -eq $_){    # if space is the current character
                $s[$x+0]           # RETURN indexof space array. incl. "+0" in the index depth so we don't need to initialize $x
                $x=($x+1)%2        # x++ but modulus 2
            }
            else{
                $c.ToLower()       # RETURN lowercase
            }
            $i++                   # increment $i for lookahead
         }
     )-join''                      # [char[]] back to [string]. implicit RETURN from function
 }
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 20 bytes
```
aR`. `{UC@a."_-"@Uv}
```
Takes input as a single command-line argument with words space-separated. [Attempt This Online!](https://ato.pxeger.com/run?1=m724ILNgwYKlpSVpuhZbEoMS9BQSqkOdHRL1lOJ1lRxCy2ohUlAVN7WjlZISk7PLE4tSihUyKpOKMlMUivMSs1MVslOTEpMUkhNzU3OAZHGqUixUDwA)
### Explanation
```
aR`. `{UC@a."_-"@Uv}
a                     Command-line argument
 R                    Replace
  `. `                matches of this regex: any character followed by a space
      {            }  With this callback function:
          a             The matched string
         @              's first character
       UC               Uppercased
           .            Concatenated to
                  v       A number, initially -1
                 U        Increment
                @         and use as a cyclical index into
            "_-"          That string
```
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-p`, 39 bytes
```
gsub(/(.) /){$1.upcase+"_-"[($.+=1)%2]}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpclm0km6BUuyCpaUlaboWN9XTi0uTNPQ19DQV9DWrVQz1SguSE4tTtZXidZWiNVT0tG0NNVWNYmshyqG6FmzKz0tVKCnPVyjJKEpNVUjLLy2CyAAA)
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 18 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
®ou qÃov
ò mq'_ q-
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=rm91IHHDb3YK8iBtcSdfIHEt&input=WwpbIm8iICJuIiAiZSJdClsidCIgInciICJvIl0KWyJ0IiAiaCIgInIiICJlIiAiZSJdClsiZiIgIm8iICJ1IiAiciJdCl0)
Input as an array of character arrays.
Explanation:
```
®ou qÃov  
®    Ã    # For each word in the input:
 ou       #  Convert the last letter to uppercase
    q     #  Join to a string
      o   # For the last word:
       v  #  Convert it to lowercase
          # Save as U
ò mq'_ q- 
ò         # Cut U into pairs of words
  m       # For each pair:
   q'_    #  Join to a single string with "_" in between
       q- # Join all those strings with "-" between
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-hP`](https://codegolf.meta.stackexchange.com/a/14339/), 16 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Takes input as a 2D character array.
```
ÇiUËouÃíUî"_-"¹c
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWhQ&header=uG1x&code=x2lVy291w%2b1V7iJfLSK5Yw&input=ImJhY2t3YXJkcyBoeWJyaWQgc25ha2Uga2ViYWIgY2FtZWwgY2FzZSI)
```
ÇiUËouÃíUî"_-"¹c     :Implicit input of 2D character array U
Ç                    :Pop last element, pass it through the following function & push back
 i                   :  Prepend
  UË                 :    Map the remaining elements of U
    o                :      Modify last
     u               :        Uppercase
      Ã              :    End map
       í             :    Interleave
        Uî"_-"       :      Mould "_-" to length of U
              ¹      :  End prepend
               c     :  Flatten
                     :Implicitly join and output last element
```
]