Rotate: Difference between revisions

From The K Language Wiki
Content added Content deleted
m (Lowercase)
("Remove lowercase again - it is in the template now")
Line 1: Line 1:
{{lowercase title}}
{{primitive|x!y|in=K3}}
{{primitive|x!y|in=K3}}



Revision as of 02:02, 9 July 2022

Rotate
x!y
Supported in K3

rotate[1] is a verb that rotates an array y by the number of elements given in x.

Positive x rotates left, and negative x rotates right.

  2! 1 2 3 4 5 6 7
3 4 5 6 7 1 2
  -2! 1 2 3 4 5 6 7
6 7 1 2 3 4 5
Works in: Kona

References