You just recently got a new phone, but you don't quite like the way it vibrates, you've decided you want to create your own vibration patterns. So, you've written a program where you used the keywords long
, short
and pause
to make your phone vibrate according to these keywords.
Task
Create a small program that accepts a string of long
, short
, and pause
and outputs another string representing the phonetic sound of a phone vibrating; Rrrr - Rr
long
sounds are Rrrr
short
sounds are Rr
(Casing matters)
pause
is a dash -
all sounds are delimited by dash with surrounding spaces ' - '
Test Cases
input: long long short long short
output: Rrrr - Rrrr - Rr - Rrrr - Rr
input: long long long short short short
output: Rrrr - Rrrr - Rrrr - Rr - Rr - Rr
input: short short short pause short short short
output: Rr - Rr - Rr - - - Rr - Rr - Rr
input: long short short long long pause short short
output: Rrrr - Rr - Rr - Rrrr - Rrrr - - - Rr - Rr
This is a code-golf question so answers will be scored in bytes, with the fewest bytes winning.
-
? This is the case in your example, but is not specified anywhere. \$\endgroup\$