S-08 - /* which Quad to inspect? */ } Letter; typedef...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Code to be used only when debugging lives inside Debug(). * Code to be used only when collecting statistics lives inside Stat(). */ #ifdef DEBUG #define Debug(x) x #else #define Debug(x) #endif #ifdef STAT #define Stat(x) x #else #define Stat(x) #endif /* A Word remembers the information about a candidate word. */ typedef struct { Quad aqMask[MAX_QUADS]; /* the word's mask */ char * pchWord; /* the word itself */ unsigned cchLength; /* letters in the word */ } Word; typedef Word * PWord; typedef Word * * PPWord; PWord apwCand[MAXCAND]; /* candidates we've found so far */ unsigned cpwCand; /* how many of them? */ /* A Letter remembers information about each letter in the phrase to be * anagrammed. */ typedef struct { unsigned uFrequency; /* how many times it appears */ unsigned uShift; /* how to mask */ unsigned uBits; /* the bit mask itself */ unsigned iq;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /* which Quad to inspect? */ } Letter; typedef Letter * PLetter; Letter alPhrase[ALPHABET]; /* statistics on the current phrase */ #define lPhrase(ch) alPhrase[ch2i(ch)] /* quick access to a letter */ int cchPhraseLength; /* number of letters in phrase */ Quad aqMainMask[MAX_QUADS];/* the bit field for the full phrase */ Quad aqMainSign[MAX_QUADS];/* where the sign bits are */ int cchMinLength = 3; /* auGlobalFrequency counts the number of times each letter appears, summed * over all candidate words. This is used to decide which letter to attack * first. */ unsigned auGlobalFrequency[ALPHABET]; char achByFrequency[ALPHABET]; /* for sorting */ char * pchDictionary; /* the dictionary is read here */ #define Zero(t) memset(t, 0, sizeof(t)) /* quickly zero out an integer array */...
View Full Document

Page1 / 2

S-08 - /* which Quad to inspect? */ } Letter; typedef...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online