Ly, 25 bytes
irsp[' =:' *lf-o'?*+sp]lo
ir - read inp as codepoints on stack, reverse
sp - stash the first char, then delete
[ ] - loops over the 2-N chars on the stack
' = - push 0|1 from comparing curr char to " "
: - copy the 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
'? - load 63 (diff between " " and "_")
* - multiple by "is space" boolean
+ - converts " " chars to "_"
sp - stash the curr char and delete from stack
lo - print the last char (pulled up backup cell)
cnamejj
- 2.9k
- 10
- 11