Flexagonal flexagation
Haskell (Lambdabot), 270 234 bytes

(!)=((map(snd&lt;$&gt;).groupBy((.fst).(==).fst).sortOn fst).).zip.cycle
o n(a,b)|n&gt;1||b&lt;1=(mod(a+[-1,1,0,0]!!n)3,mod(b+[0,0,-1,1]!!n)3)
(x&amp;y)d|(g,h)&lt;-foldl(flip(.))id(o&lt;$&gt;d)(0,0)=([0,1,2]!x++[3,3,4,4,5,5]!y)!!([0,5,1,1,4,2,2,3,0]!!(3*g+h))


Usage:

&gt; (&amp;) "hexaflexaperplexia" "flexagationdevices" [1,3]
"exioic"


[0,1,2,3] = [left,right,up,down]

Thanks to @Damien for a lot of bytes!