Any regular hexagon can be tiled with diamonds, for instance like so (stolen from this question):
______
/_/_/\_\
/_/\_\/\_\
/\_\/_/\/_/\
\/_/\_\/_/\/
\_\/_/\_\/
\_\_\/_/
We'll consider the above a tiling of size 1 (since the diamonds' sides are made of one / or \ each). The same tiling of size 2 would look like:
____________
/ / /\ \
/___/___/ \___\
/ /\ \ /\ \
/___/ \___\/ \___\
/\ \ / /\ / /\
/ \___\/___/ \/___/ \
\ / /\ \ / /\ /
\/___/ \___\/___/ \/
\ \ / /\ \ /
\___\/___/ \___\/
\ \ \ / /
\___\___\/___/
Your task is to rotate diamond tilings by a multiple of 60 degrees. The diamond tiling in the input can be in any size (and the size is not explicitly specified in the input). But it would always be a valid tiling, and all sides of the hexagon would have the same length.
These are the above examples rotated by 60 degrees clockwise:
______
/_/\_\_\
/\_\/_/\_\
/\/_/\_\/_/\
\/\_\/_/_/\/
\/_/\_\_\/
\_\/_/_/
____________
/ /\ \ \
/___/ \___\___\
/\ \ / /\ \
/ \___\/___/ \___\
/\ / /\ \ / /\
/ \/___/ \___\/___/ \
\ /\ \ / / /\ /
\/ \___\/___/___/ \/
\ / /\ \ \ /
\/___/ \___\___\/
\ \ / / /
\___\/___/___/
The input is a non-negative integer and a diamond tiling. Your program (or function) should rotate it by the integer * 60 degrees. You decide whether to rotate clockwise or counterclockwise, as long as it is consistent. Both the input and output shouldn't have extra leading or trailing spaces.
This is code-golf. Shortest code wins.
Related questions: