#define DICT "/usr/dict/words"
#define EDICT "/crp/dict/web2"
main(argc
,argv
) char **argv
;
if(argc
==1) dictfile
=DICT
;
else if(*argv
[1]=='-') dictfile
=EDICT
;
if((dict
=fopen(dictfile
,"r"))==NULL
) fatal("no dictionary");
if(stat(dictfile
,&statb
)<0) fatal("can't stat");
char word
[26],alph
[26],realword
[26];
for(i
=0;i
<26;i
++) word
[i
]=alph
[i
]=realword
[i
]=0;
if(alph
[i
]!=0) putchar(alph
[i
]);
printf(" word: %s ",word
);
printf("errors: %d/%d\n",MAXERR
-alive
,MAXERR
);
if((c
=gbuf
[0])<'a' || c
>'z')
{ printf("lower case\n");
{ printf("you guessed that\n");
for(i
=0;realword
[i
]!=0;i
++)
printf("the answer was %s, you blew it\n",realword
);
printf("you win, the word is %s\n",realword
);
fprintf(stderr
,"%s\n",s
);
if(fscanf(dict
,"%s\n",wbuf
)==EOF
)
if((c
=wbuf
[0])>'z' || c
<'a') goto loop
;
for(i
=j
=0;wbuf
[j
]!=0;i
++,j
++)
if((c
=wbuf
[j
])<'a' || c
>'z') goto loop
;
for(j
=0;j
<i
;word
[j
++]='.');
{ 42066, 9228, 24412, 14500, 55162,
6098, 11992, 12648, 48241, 639,
2944, 33351, 15545, 35618, 36211,
16033, 937, 36686, 34957, 37544,
17621, 5453, 3028, 1556, 12875,
if(words
!=0) printf("(%4.2f/%.0f) ",errors
/words
,words
);