Word wheel: Difference between revisions
m
→{{header|Pascal}}
No edit summary |
|||
Line 1,808:
begin
AssignFile(WordList, WordFile);
Reset(WordList);
▲ writeln('Could not open dictionary file ' + WordFile);
▲ 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('
end.
</lang>
|