Circular Shift

by Ricardo Fernández Serrata

Version 3 (April 22, 2022)

Download (1 downloads)

Rotates ANY value in 1 dimension (linear), dictionaries included.

x is the value to be rotated and d is the distance (rotation amount). If LR is falsy, rotates left. If LR is truthy, rotates right.

Also supports negative distances, but it may have bugs.

If the input is a text string with surrogate pairs, the rotation will glitch the text. To handle any Unicode string, you must use `findAll(text, "(?s).")` (equivalent to `split(text, "(?u)")`) to split it into an array of code-points, instead of code-units, then `join` at the end of processing.

LICENSE: https://unlicense.org/

3.0 average rating from 1 reviews

5 stars
0
4 stars
0
3 stars
1
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.