S-12 - printf(StringFormat, apwCand[u]->pchWord,...

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

View Full Document Right Arrow Icon
pw = NextWord(); bzero(pw->aqMask, sizeof(Quad)*MAX_QUADS); /* Zero(pw->aqMask); */ pw->pchWord = pchWord; pw->cchLength = cchLength; for (i = 0; i < ALPHABET; i++) { pw->aqMask[alPhrase[i].iq] |= (Quad)cchFrequency[i] << alPhrase[i].uShift; } } /* AddWords -- build the list of candidates */ void AddWords(void) { char * pch = pchDictionary; /* walk through the dictionary */ cpwCand = 0; while (*pch) { if ((pch[1] >= cchMinLength && pch[1]+cchMinLength <= cchPhraseLength) || pch[1] == cchPhraseLength) BuildWord(pch+2); pch += *pch; } fprintf(stdout, "%d candidates\n", cpwCand); } void DumpCandidates(void) { unsigned u; for (u = 0; u < cpwCand; u++)
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: printf(StringFormat, apwCand[u]-&gt;pchWord, (u % 4 == 3) ? '\n' : ' '); printf(&quot;\n&quot;); } PWord apwSol[MAXSOL]; /* the answers */ int cpwLast; Debug( void DumpWord(Quad * pq) { int i; Quad q; for (i = 0; i &lt; ALPHABET; i++) { if (alPhrase[i].uFrequency == 0) continue; q = pq[alPhrase[i].iq]; if (alPhrase[i].uShift) q &gt;&gt;= alPhrase[i].uShift; q &amp;= alPhrase[i].uBits; while (q--) putchar('a'+i); } putchar(' '); } ) /* End of debug code */ void DumpWords(void) { int i; for (i = 0; i &lt; cpwLast; i++) wprint(apwSol[i]-&gt;pchWord); printf(&quot;\n&quot;); } Stat(unsigned long ulHighCount; unsigned long ulLowCount;)...
View Full Document

This note was uploaded on 12/20/2009 for the course ECE 466 taught by Professor Staff during the Fall '09 term at Clarkson University .

Page1 / 2

S-12 - printf(StringFormat, apwCand[u]-&amp;amp;gt;pchWord,...

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