Jump to content

Word wheel: Difference between revisions

m
Line 1,798:
WheelSize = 9;
MinLength = 3;
WordFileWordListFN = 'unixdict.txt';
 
procedure search(patternWheel : string);
var
Allowed, Required, Available, w : string;
Len, i, p : integer;
WordListWordFile : TextFile;
Match : boolean;
begin
AssignFile(WordListWordFile, WordFileWordListFN);
try
Reset(WordListWordFile);
except
writeln('Could not open dictionary file ' + WordFileWordListFN);
exit;
end;
Allowed := LowerCase(patternWheel);
Required := copy(Allowed, 5, 1); { central letter is required }
while not eof(WordListWordFile) do
begin
readln(WordListWordFile, w);
Len := length(w);
if (Len < MinLength) or (Len > WheelSize) then continue;
Line 1,839:
writeln(w);
end;
CloseFile(WordListWordFile);
end;
 
211

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.