David Otton <[EMAIL PROTECTED]>
To: Ralph Guzman <[EMAIL PROTECTED]>
Cc: PHP General Mailing List <[EMAIL PROTECTED]>
Sent: Tuesday, September 11, 2001 2:32 PM
Subject: Re: [PHP] Anagram Solution in PHP
> On Mon, 10 Sep 2001 01:25:36 -0700, you wrote:
>
> >So let
On Mon, 10 Sep 2001 01:25:36 -0700, you wrote:
>So let's say the word 'acronym'
>
>A + C + R + 0 + N + Y + M
>26 + 24 + 9 + 12 + 13 + 2 + 14 = 100
>
>My thoughts were to download a list of words in the dictionary, then read
>the file and somehow replace each letter by its number, then add ea
I tried that code this morning :
26,"b"=>25,"c"=>24,"d"=>23,
"e"=>22,"f"=>21,"g"=>20,"h"=>19,
"i"=>18,"j"=>17,"k"=>16,"l"=>15,
"m"=>14,"n"=>13,"o"=>12,"p"=>11,
"q"=>10,"r"=>9,"s"=>8,"t"=>7,
"u"=>6,"v"=>5,"w"=>4,"x"=
Sounds like you know exactly what you want to do :-)
1) Obtain a text file, csv or whatever of a dictionary (easy enough -
www.google.com).
2) Find the ascii values for a-z or A-Z, your choice.
3) Read in a word at a time.
4) Convert to upper or lower case to reflect part (2)
5) Create a sim
4 matches
Mail list logo