# I've been alphabet hunting for a while

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:

1. Alphabets can be uppercase or lowercase (but not both). So, you need to look for ABCDEFGHIJKLMNOPQRSTUVWXYZ and abcdefghijklmnopqrstuvwxyz, but not AbCdeFGhIJkLmNOpQRsTuvwxyZ. That is, only look for alphabets that are composed of entirely one case.
2. Alphabets can shift around. they may not always start with A, but instead may start with G or U. So you'll have to look for things like OPQRSTUVWXYZABCDEFGHIJKLMN.
3. Alphabets may not always read forwards. They can also read backwards, up, and down. E.g., ZYXWVUTSRQPONMLKJIHGFEDCBAis 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 , 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
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

• "I'm sick of alphabet challenges. Here's an alphabet challenge." lol +1 – AdmBorkBork Aug 9 '16 at 20:26
• Can we have the input be padded with spaces to form a rectangle? :3 – Downgoat Aug 9 '16 at 21:18
• @Downgoat Yes, you can. – Conor O'Brien Aug 9 '16 at 21:20
• – Leaky Nun Aug 9 '16 at 23:29
• Can we take a 2D array of strings? Each row would be a line, right-padded with spaces to form a rectangle – Luis Mendo Aug 10 '16 at 0:43

# Jelly, 2823 22 bytes

1 byte thanks to Dennis.

26RØAṙ;U$;Œl$
;Zẇ@þ¢FS


Try it online!

Takes an array of strings.

• wat how is jelly always so short .___. – Downgoat Aug 10 '16 at 0:35
• @Downgoat are you Jelly? – Patrick Roberts Aug 10 '16 at 11:51
• @PatrickRoberts <s>yes</s> no i am goat – Downgoat Aug 10 '16 at 19:50

# Cheddar, 148 bytes

(s,b=65@"90,c?)->(|>27).map(->s has(b=b.slice(1)+b[0])||s has b.lower||(1|>3).map(j->(c=s.lines.turn(j).vfuse)has b||c has b.lower?1:0).sum?1:0).sum


Try it online!

## Non-copmeting, 146 132 bytes

This is the exact same as above except map(...?1:0).sum has become any(...).

(s,b=65@"90,c?)->(|>27).any(->s has(b=b.slice(1)+b[0])||s has b.lower||(1|>3).any(j->(c=s.lines.turn(j).vfuse)has b||c has b.lower))


Rather slow but it works ¯\_(ツ)_/¯ . added any function after challenge release date.

The input does not need to be padded with whitespaces. But if an input doesn't work, pad it with whitespaces to make rectangle. The turn function is really finicky and I'm not sure when it works and when it doesn't

### Explanation

Loops through all possible cycles of alphabet. On each iteration check if the current cycle of alphabet exists in the string, if not, check if any of the possible rotations of the string have the alphabet.

### Ungolfed

(str, a = 65@"90)->
(|>27).any(->
str has (a = a.slice(1) + a[0]) ||
str has a.lower                 ||
(1|>3).any(j ->
(c = str.lines.turn(j).vfuse) has a ||
c has a.lower
)
)

• What does c? mean? – Conor O'Brien Aug 10 '16 at 0:38
• @ConorO'Brien c? means optional argument. basically the same as c=nil – Downgoat Aug 10 '16 at 0:40
• Make a competing version, then put this non-competing version at the bottom. – Leaky Nun Aug 10 '16 at 0:41
• @LeakyNun working on it, can't figure out how to without {} though – Downgoat Aug 10 '16 at 0:42
• any(...) is just map(...?1:0).sum – Leaky Nun Aug 10 '16 at 0:43

## 05AB1E, 43 bytes

AÂ‚Duìvy26FÀD}})U|Dø€J)˜vXDgsrFysk>ˆ}}¯O__


Explanation in short

Get different variations of alphabet (caps, no-caps, reversed, normal) and store in X.

AÂ‚Duìvy26FÀD}})U


Get each row and column of input as a list of strings.

                 |Dø€J)˜


Check each such string if it contains a variation of the alphabet.

                        vXDgsrFysk>ˆ}}


Sum and double negate, giving 1 for true and 0 for false.

                                       ¯O__


Try it online

# Python, 182 bytes

Doesn't feel very 'golfed', but ...

import re
a='abcdefghijklmnopqrstuvwxyz'
P,N='|\n'
p=P.join(a[i:]+a[:i] for i in range(26))
p+=P+p[::-1]
p+=P+p.upper()
lambda s:re.search(p,s+N+N.join(map(''.join,zip(*s.split(N)))))


Theory of operation:

First, build a regex pattern combining all the possible alphabets:

p=P.join(a[i:]+a[:i] for i in range(26)) builds a string of all rotations of 'a' joined with '|'. e.g. "abc...z|bcd...za|..."

p+=P+p[::-1] appends a reversed version of itself.

p+=P+p.upper() appends an uppercase version.

Then create a long string combining the original s and a version of s with the columns turned into rows:

N.join(map(''.join,zip(*s.split(N)))) flips the rows and columns, so 'a\nb\nc' becomes 'abc'

return true if the pattern is in the long string.

• Pretty sure you don't need regex to do this; specifically, in checks for substring. – Leaky Nun Aug 10 '16 at 4:22
• @LeakyNun, I was trying to avoid lots of loops over the possible alphabets (rotations, reversals, case). The regex pattern has all the possibilities--using just one loop. Also, the string to search includes the input string in both normal and row-flipped versions, so no looping there either. – RootTwo Aug 10 '16 at 5:08