Skip to content

Instantly share code, notes, and snippets.

@stripthis
Created April 21, 2013 16:48
Show Gist options
  • Save stripthis/5430226 to your computer and use it in GitHub Desktop.
Save stripthis/5430226 to your computer and use it in GitHub Desktop.
List of english words that sum of letters is 42
<?php
// words are there
// http://www.infochimps.com/datasets/word-list-100000-official-crossword-words-excel-readable/downloads/144625
$handle = @fopen("words.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
$w = str_split(rtrim($buffer));
$sum = 0;
foreach ($w as $letter) {
$sum += (ord($letter)-96);
}
if($sum == 42) {
echo $buffer.'<br/>';
}
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}
?>
abbacies
acclaim
acedias
acetal
aching
achoo
acidy
acnes
acnode
adamance
adapt
adduced
adipic
agamas
agapeic
agone
agora
aidman
aims
airn
alamo
aleph
alias
alibied
alit
allege
alodia
amahs
ameer
amido
amine
amis
ammo
amoebae
angas
anime
annal
apical
arcane
arcked
axel
axle
azan
azo
babbler
backbend
baggy
bagmen
balanced
balder
banjo
baobabs
barbs
basked
bast
bats
beading
beaker
bechalk
bedeafen
bedpan
bedrid
beebread
beechen
befell
befit
behind
beladied
beldame
bemata
berake
bidder
biffs
bipack
birded
bitch
bize
blabber
blahs
blared
blende
blew
blobbed
bobbled
boy
brabble
brachia
brail
brim
buccal
bumf
bura
bus
cables
cabobs
cacaos
cadelle
camber
camped
campi
canes
canoed
carbide
carcel
carked
cart
cathead
caudal
cebids
ceding
cent
chafes
changed
charge
charka
chez
chics
chimed
choke
chop
clachan
clags
clime
cloak
coact
cockade
codable
codas
coifed
colic
combed
cooed
corf
cox
crambe
creche
creek
cur
cyma
dacker
daffy
dagger
dames
dawn
deacon
deadbeat
deadened
dealt
dearie
decamp
decease
decks
deduce
defacer
defence
defleaed
deified
delta
demean
dens
deuced
diacidic
diddled
didy
dirk
docked
doer
dogged
dow
duel
easel
edified
educed
eerie
egger
elegiac
elodea
embedded
emes
ends
erne
ers
faciend
fadges
fakes
fancied
faradic
farcie
farle
faun
fazed
female
femme
feral
fetch
fiacre
fibber
fices
final
fired
fish
five
flagged
flare
flaw
fobs
fogie
foil
fou
franc
fried
gabbing
gambs
gaum
gawk
genoa
gibes
giddied
gift
gigs
glance
gnat
gnu
goas
got
guaiac
guck
gun
hacks
hadjs
hakim
halakah
hallah
haul
heath
hemp
henna
hexad
hijack
hoar
honda
hone
hood
hora
hula
hum
ibidem
icing
ins
japan
jibbs
jigged
jole
keeled
kegs
kiang
kiddie
knap
knob
kop
lady
lambie
lamp
larch
lark
lated
lati
leakage
lease
leeched
leet
leud
ley
libra
libs
lichee
ling
loan
loo
lye
macchie
mahoe
maria
math
meads
melic
mell
minae
mock
mon
nave
necked
new
nine
nodi
nom
nth
ocrea
odds
ohs
paddle
pajama
palaced
palm
pataca
pate
pay
peached
peaked
peat
pebble
peep
pieced
pile
plaid
plie
pya
racked
radar
rads
ragged
rain
ramee
rani
rare
raw
rear
rebel
redan
rediae
redo
refaced
res
rode
sacra
sacs
sago
sanga
sard
scena
sebacic
seeded
seem
self
seme
send
ser
shack
sick
sima
sin
skeg
sned
stab
sub
tabs
tail
tali
tang
tape
tau
tedded
tele
tepa
thecae
tided
tog
unbe
uta
vanda
vane
vara
vas
vena
voe
wame
wand
war
wen
yagi
yald
yap
zig
zoa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment