blob: 009e283a0b40454f1d62b7bda29d2f014abaf3d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
⍝ Load Dictionary
dict ← ⊃⎕NGET '/home/cph/perlweeklychallenge-club/data/dictionary.txt' 1
⍝ Remove words with duplicates
uniq ← dict/⍨(≢∘∪=≢)¨dict
⍝ Define pangram function
pangram ← {
26>≢∪∊⍵ : findNext ⍵,⊂(?∘≢⊃⊢)uniq/⍨(⊃(⌽⎕C ⎕A)~∊⍵)∘∊¨uniq ⋄ ⍵
}
⍝ Find a "short" pangram
↑{⍵/⍨((⌊/=⊢)≢¨)⍵}pangram ¨ 10/⊂⍬
┌───────┬────┬──────┬─────────┬──────┬─────┬────────┬──────┐
│wizards│sexy│shoved│computing│quirks│bleat│jaundice│famous│
└───────┴────┴──────┴─────────┴──────┴─────┴────────┴──────┘
⍝ In (modified) sentence version:
'Sexy wizards computing quirks on behalf of juveniles.'
|