| Bytes | Lang | Time | Link |
|---|---|---|---|
| 243 | Swift 6 | 250704T220029Z | macOSist |
| 018 | Uiua | 250704T021219Z | ErikDaPa |
| 015 | Japt x | 250705T152824Z | Shaggy |
| 123 | Ruby | 250706T062620Z | Value In |
| 014 | Vyxal 3.4.5 d | 250702T191406Z | pacman25 |
| 043 | 05AB1E | 160810T200147Z | Emigna |
| 182 | Python | 160810T033832Z | RootTwo |
| 148 | Cheddar | 160810T002452Z | Downgoat |
| 022 | Jelly | 160810T001717Z | Leaky Nu |
Swift 6, 255 243 bytes
let e="|",a="abcdefghijklmnopqrstuvwxyz",p=".^"+a.indices.flatMap{e+a[$0...]+a[..<$0]},o=p.reversed()+p,h={(n:String)in(0..<n.count).reduce(n){s,r in s+e+n.split{$0<" "}.map{r<$0.count ?[_]($0)[r]:" "}}.contains(try!Regex(o+e+o.uppercased()))}
h: (String) -> Bool is the closure to call.
Uiua, 18 bytes
/↥⊂∩≡(≍+@A⇡26⍆⌵)⊸⍉
Explanation:
/↥⊂∩≡(≍+@A⇡26⍆⌵)⊸⍉
∩ ⊸⍉ => search in both rows and cols
≡(≍+@A⇡26⍆⌵) => for each row/col, are they a variation of the alphabet?
/↥⊂ => join both boolean masks and reduce OR
Japt -x, 15 bytes
Out & about on my phone, so I'm not certain this is right. Outputs 1 for true or 0 for false.
;4ÆzX ·dȲøB·pC
Possible 13 bytes
Needs more testing
;WzV ·Ë²ø[BC]
Explanation
;4ÆzX ·dȲøB·pC :Implicit input of string U
2Æ :Map each X in the range [0,4)
zX : Rotate U 90° X times
· : Split on newlines
d : Any truthy
È : When passed through the following function
² : Duplicate
ø : Contains any element of the array
; B : Uppercase alphabet
· : Split on newlines
p : Push
; C : Lowercase alphabet
:Implicit output of sum of resulting array
Ruby, 123 bytes
->n{l=n.lines
f=->c{[*?A..?Z]-c==[]||[*?a..?z]-c==[]}
l.any?{f[_1.chars]}||(0..l.map(&:size).max).any?{|i|f[l.map{_1[i]}]}}
Vyxal 3.4.5 d, 14 bytes
T“;kLṁ4÷ᵛᶨṘfᵒc
using a very old version of v3 because the parser breaks on spaces for some of the old ones and i wanted the old modifiers to save like 8 bytes
05AB1E, 43 bytes
A‚Duìvy26FÀD}})U|Dø€J)˜vXDgs`rFysk>ˆ}}¯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.
vXDgs`rFysk>ˆ}}
Sum and double negate, giving 1 for true and 0 for false.
¯O__
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.
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
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
)
)