Word wheel: Difference between revisions

m
No edit summary
Line 1,808:
begin
AssignFile(WordList, WordFile);
{$I-} try
Reset(WordList);
{$I+}except
writeln('Could not open dictionary file ' + WordFile);
if IOResult <> 0 then
beginexit;
end;
writeln('Could not open dictionary file ' + WordFile);
exit;
end;
Allowed := LowerCase(pattern);
Required := copy(Allowed, 5, 1); { central letter is required }
while not eof(WordList) do
begin
readln(WordList, w);
Len := length(w);
Available := Allowed;
if (Len < MinLength) or (Len > WheelSize) then continue;
if pos(Required, w) = 0 then continue;
Available := Allowed;
Match := True;
for i := 1 to Len do
Line 1,845 ⟶ 1,843:
{ exercise the procedure }
begin
search('NDEOKGELWNDE' + 'OKG' + 'ELW'); {3 x 3 letter grid }
end.
</lang>
211

edits