Introductions
A 2×n Boolean matrix can be represented as a string of the four characters . ':
.
The string has an "upper row" and a "lower row", with dots representing 1s and empty spaces representing 0s.
For example, the 2×6 matrix
1 0 1 0 0 1
0 0 0 1 0 1
can be represented as ' '. :
.
Your task is to take a matrix in this "compressed form", and rotate its entries one step clockwise, like a conveyor belt.
Input
Your input is a single string over the characters . ':
.
Its length is guaranteed to be at least 2.
Output
Your output shall be the input string, but with every dot rotated one step in the clockwise direction. More explicitly, the dots on the upper row more one place to the right, except the rightmost one, which moves down. The dots on the lower row move one step to the left, except the leftmost one, which moves up. In particular, the output string must have the same length as the original, and whitespace is significant.
Example
Consider the input string :..:'.
, which corresponds to the 2×6 matrix
1 0 0 1 1 0
1 1 1 1 0 1
The rotated version of this matrix is
1 1 0 0 1 1
1 1 1 0 1 0
which corresponds to the string ::. :'
.
Rules and scoring
You can write a full program or a function. The lowest byte count wins, and standard loopholes are disallowed. You can decide whether the input and output are enclosed in quotes, and one trailing newline is also acceptable in both.
Test cases
These test cases are enclosed in double quotes.
" " -> " "
" ." -> ". "
". " -> "' "
"' " -> " '"
" '" -> " ."
": " -> "''"
"''" -> " :"
":." -> ":'"
":.'" -> ":'."
"..." -> ":. "
": :" -> "':."
"':." -> ".:'"
".:'" -> ": :"
" " -> " "
"::::" -> "::::"
":..:'." -> "::. :'"
" : .:'" -> ". '.. :"
": ''. :" -> "'' :'.."
"........" -> ":...... "
":::: " -> ":::'' "
" ::::" -> " ..:::"
" : : : : " -> ". : : : '"
".'.'.'.'.'" -> "'.'.'.'.'."
".. :: '.' :." -> ": ..'' .' :.'"
".' '.:: :.'. . ::.' '. . .::' :.'." -> "' ' .:.''..'.'. ..:' ' .'. ...'''..'.'"