sub show-rotations(@a) {
.say for @a;
say "\n-----\n";
my &rotate := -> @a { (^@a).map: { @a[*;$_].reverse } }
for ^3 { @a = rotate @a; .say for @a; say "\n-----\n" }
}
show-rotations [(1, 2, 3), (4, 5, 6), (7, 8, 9)];
show-rotations [(1, 2, 3, "a"), (4, 5, 6, "b"), (7, 8, 9, "c"), ("d", "e", "f", "g")];
show-rotations [(1, 2, 3, "a", "A"), (4, 5, 6, "b", "A"), (7, 8, 9, "c", "A"), ("d", "e", "f", "g", "A"), ("A", "E", "I", "O", "U")];