Post History
Uiua, 27 bytes* Function definition. Takes string as argument, returns 0/1 for false/true. ≍♭1◴⧈(≍⇡₁2⍆⌵-)⍉⊟⊃◿₅(⌊÷₅)-@A Uiua pad this online *: assuming a single-byte coding scheme (SBCS) is a...
#1: Initial revision
# [Uiua][uiua], 27 bytes*
Function definition. Takes string as argument, returns 0/1 for false/true.
```uiua
≍♭1◴⧈(≍⇡₁2⍆⌵-)⍉⊟⊃◿₅(⌊÷₅)-@A
```
[Uiua pad this online][pad]
*: assuming a single-byte coding scheme (SBCS) is acceptable.
## Explanation
```uiua
≍♭1◴⧈(≍⇡₁2⍆⌵-)⍉⊟⊃◿₅(⌊÷₅)-@A
-@A subtract letter 'A' to yield numeric
alphabet positions [0-24]
⊃ fork both
◿₅ x and
(⌊÷₅) y coordinate calculations
which yields two 1-dimensional arrays
⊟ coupled to a wide 2xN array and
⍉ transposed to a tall Nx2 array of [x y] rows
⧈( ) stencil to operate on row pairs
- calculate differences
⌵ drop any negative signs
⍆ sort coordinate pair ascending
≍⇡₁2 compare against the only good [1 2] pair
which yields an array of matches
◴ deduplicate the matches
≍♭1 and compare against the array [1]
```
[uiua]: https://uiua.org/
[pad]: https://uiua.org/pad?src=0_19_0-dev_4__eJx1zT1OwzAYxvG9p4gytUMlyglw_JX4K3biJPZxCGohUSOxVZ0QUiUmNhAjAzd5T4K6tUSMj_TT_2EJ7J4TGCY4vm_g8AFvT8vzenyF_v4Wph3sP9crmAYYX2B8gMM39Nsl7MefL-i3q_UdWsB0gtMRhinZJCxJtcDMhZJw2_kik22dUxOrRqH0r0SqqaKhed3KrPCd5aQMjmGhL-XNWV51Lg9m8p8iUjOpikzYzmDm2zpHZVNxooOLks6kYYRXUdLcBSuw6nyByqZudTaTVZnLlvhCNTgabrOgRU075NhM5rRDqhYhk1VJWuYMjoXXljfp4hdNEZzO
