As Calvin pointed out, its a pain to do the string length and other calculations, so I went back and rewrote the anagram calculation using the prime number trick. That is, assign a prime to each letter from ‘a’ to ‘z’, then you can easily tell if two words are anagrams by multiplying all the [...]
Rewriting the Anagram program
April 12th, 2008 · No Comments · Geek
Tags: 26 Letters·64 Bits·Alphabet·Anagram Program·Integer Overflow·Integers·Mac·Match·Mouthful·Prime Factors·Prime Number·Qz·Real World·Reference Letter·Running·Scrabble·Scrabble Dictionary·String Length·World Dictionary·Worst Case
Anagram Solver
April 10th, 2008 · 2 Comments · Calvin
Calvin wants to solve anagrams. There are lots of great programs out there, but not much source. Gtoal.com has a good list of source code that is out there, but its hard to find a simple program.
Gtanag.mai is perhaps the simplest program that is a C program. I’m sure you could use it in [...]
Tags: Anagram Solver·Anagrams·Brute Force·C Program·Canonical Form·Chir·First Command·Google·Google Search·Linkage·Mac OS X·Os X·Prime Number·Primes·Program Search·Rockefeller·Sorts·Source Code·Unix·Unix Dictionary·Unix V7·Word Dictionary