Vyxal s, 1712 bytes
Ṙ⌈ḣǐJ ̈2∷‛_ṫ$RǐR5‛_-iJ;ṅṪṘẎYp
-5 bytes thanks to emanresuA
How?
ṫ$RǐR5‛_-ẎYp
ṫ # Tail extract, push a[:-1] and a[-1]
$ # Swap
R # Reverse each
ǐ # Capitalize first letter of each
R # Reverse each
5 # 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
Vyxal s, 12 bytes
ṫ$RǐR5‛_-ẎYp
-5 bytes thanks to emanresuA
How?
ṫ$RǐR5‛_-ẎYp
ṫ # Tail extract, push a[:-1] and a[-1]
$ # Swap
R # Reverse each
ǐ # Capitalize first letter of each
R # Reverse each
5 # 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
Vyxal, 2017 bytes
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_Ṙ⌈ḣǐJ ̈2∷‛_-iJ;ṅṪiJ;ṅṪṘ
ƛṫ⇧J; could also be (⇧uvV, and ̈2∷‛_-iJ; could also be ‡1-ẇ‡\_JẆ.Try it Online!
How?
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
⌈ # Split on spaces
ṫ # Tail extract; push a[:-1] and a[-1]
$ # Swap
ƛ # For each:
ṫ # Tail extract; push a[:-1] and a[-1]
⇧ # Uppercase
J # Join together again
; # Close map lambda
p # Append the last word again
̈2 # Map over this list, pushing both item and (0-based) index:
∷ # Modulo the index by 2
‛_-i # Index that into the string "_-"
J # Append that to the word
; # Close mapping lambda
ṅ # Join this list together
Ṫ # Remove the last character
Vyxal, 20 bytes
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
ƛṫ⇧J; could also be (⇧uvV, and ̈2∷‛_-iJ; could also be ‡1-ẇ‡\_JẆ.
How?
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
⌈ # Split on spaces
ṫ # Tail extract; push a[:-1] and a[-1]
$ # Swap
ƛ # For each:
ṫ # Tail extract; push a[:-1] and a[-1]
⇧ # Uppercase
J # Join together again
; # Close map lambda
p # Append the last word again
̈2 # Map over this list, pushing both item and (0-based) index:
∷ # Modulo the index by 2
‛_-i # Index that into the string "_-"
J # Append that to the word
; # Close mapping lambda
ṅ # Join this list together
Ṫ # Remove the last character
Vyxal, 20 bytes
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
ƛṫ⇧J; could also be (⇧uvV, and ̈2∷‛_-iJ; could also be ‡1-ẇ‡\_JẆ.
How?
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
⌈ # Split on spaces
ṫ # Tail extract; push a[:-1] and a[-1]
$ # Swap
ƛ # For each:
ṫ # Tail extract; push a[:-1] and a[-1]
⇧ # Uppercase
J # Join together again
; # Close map lambda
p # Append the last word again
̈2 # Map over this list, pushing both item and (0-based) index:
∷ # Modulo the index by 2
‛_-i # Index that into the string "_-"
J # Append that to the word
; # Close mapping lambda
ṅ # Join this list together
Ṫ # Remove the last character
Vyxal, 20 bytes
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
ƛṫ⇧J; could also be (⇧uvV, and ̈2∷‛_-iJ; could also be ‡1-ẇ‡\_JẆ.
How?
⌈ṫ$ƛṫ⇧J;p ̈2∷‛_-iJ;ṅṪ
⌈ # Split on spaces
ṫ # Tail extract; push a[:-1] and a[-1]
$ # Swap
ƛ # For each:
ṫ # Tail extract; push a[:-1] and a[-1]
⇧ # Uppercase
J # Join together again
; # Close map lambda
p # Append the last word again
̈2 # Map over this list, pushing both item and (0-based) index:
∷ # Modulo the index by 2
‛_-i # Index that into the string "_-"
J # Append that to the word
; # Close mapping lambda
ṅ # Join this list together
Ṫ # Remove the last character