Y'know, we've had a lot of "alphabet" challenges recently. (one two three four five.) While I love a good challenge, and those challenges were very fun, I think it's time for a change of pace. We need to exclude such challenges in the future. It's time for automation!
You're going to find some alphabets for me, and for automation (and for glory!) Alphabets are tricky and like to disguise themselves.[citation-needed] You'll need to account for the following factors:
- Alphabets can be uppercase or lowercase (but not both). So, you need to look for
ABCDEFGHIJKLMNOPQRSTUVWXYZ
andabcdefghijklmnopqrstuvwxyz
, but notAbCdeFGhIJkLmNOpQRsTuvwxyZ
. That is, only look for alphabets that are composed of entirely one case. - Alphabets can shift around. they may not always start with
A
, but instead may start withG
orU
. So you'll have to look for things likeOPQRSTUVWXYZABCDEFGHIJKLMN
. - Alphabets may not always read forwards. They can also read backwards, up, and down. E.g.,
ZYXWVUTSRQPONMLKJIHGFEDCBA
is also a valid alphabet.
Here's an example of a string that has an alphabet:
JIHGFEDCBAZYXWVUTSRQPONMLK
This is a backwards-oriented, shifted alphabet:
JIHGFEDCBAZYXWVUTSRQPONMLK
<--------|<---------------
This also contains an alphabet:
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
A
B
C
D
E
it's a down-oriented alphabet:
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z V
A===
B |
C |
D |
E V
Your challenge is to write a program, function, etc. that, given a string, outputs/returns a truthy value if the string contains at least one alphabet, or a falsey value otherwise. This is a code-golf, so the shortest program in bytes wins.
Test cases
Truthy
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz
ZABCDEFGHIJKLMNOPQRSTUVWXYghijklmnopqrstuvwxyzabcdef
ZBCDEFGHIJghijklmnopqrstuvwxyzabcdef
AAAAAAAA
BBBBBBBB
CCCCCCCC
DDDDDDDD
EEEEEEEE
FFFFFFFF
GGGGGGGG
HHHHHHHH
IIIIIIII
JJJJJJJJ
KKKKKKKK
LLLLLLLL
MMMMMMMM
NNNNNNNN
OOOOOOOO
PPPPPPPP
QQQQQQQQ
RRRRRRRR
SSSSSSSS
TTTTTTTT
UUUUUUUU
VVVVVVVV
WWWWWWWW
XXXXXXXX
YYYYYYYY
ZZZZZZZZ
J54
Igeh
H
G
Fzx6
E
Dv
Cvzxc
Bs
Adf
Z
@Yascvf
Xsf
W
Vfas
Uw
Te
~S
R
Qasdfasdf
P
O
N
M
LMNOPQR
K
Falsey
Hello, World!
KLMNOPQRSTUVWXYZABCDEF
K ZYXW
L V
M U
N T
O S
P R
Q
A
BCDEFGHIJKLMNOPQRSTUVWXYZ
ABCDEFGHIJKLmnopqrstuvwxyz