HexaGolf: Rotatagons

Python 2, 160 158 156 148 124 bytes

Prepare to be amazed! The resulting text is drawn on a canvas... by a Turtle! :D

from turtle import*
h,n=input()
up()
rt(n*60)
l=0
for c in h:
 write(c);fd(9);l-=1
 if" ">c:fd(9*l);rt(90);fd(15);lt(90);l=0

Try it online - Supports decimal rotations as well!


If you would prefer the turtle to be shaped like one, you can add the line t.shape("turtle").

View the revision history to see past versions.

Aliases used:

up() - penup()

rt() - right()

lt() - left()

fd() - forward()

bk() - backward()

Thanks to Sherlock9 for the suggestions!


Python 2.7, 151 bytes

h,n=input()
s=1-len(h)
e=enumerate
exec n%6*"h=[''.join(c>' 'and h[y-x-3*s/2>>1][x*2+y*6+s>>2]or c for x,c in e(l))for y,l in e(h)];"
print'\n'.join(h)

Example:

% python2.7 hexarot.py <<<'[["   h e x a   ","  g o n s a  "," n d t r i a ","n g l e s m a", " k e m e s a ","  d l y m a  ","   d d e r   "],-1]'
   a a a a   
  x s i m a  
 e n r s s a 
h o t e e m r
 g d l m y e 
  n g e l d  
   n k d d