Skip to content

Instantly share code, notes, and snippets.

@migueldiab
Last active November 12, 2019 04:42
Show Gist options
  • Save migueldiab/35bd890344086e24471eb9fece7b4ab5 to your computer and use it in GitHub Desktop.
Save migueldiab/35bd890344086e24471eb9fece7b4ab5 to your computer and use it in GitHub Desktop.
function completarPalabra (prefijo : TipoPalabra; vocabulario : TipoVocabulario) : ListaPalabras;
var
lista, proxima : ListaPalabras;
palabra : TipoPalabra;
begin
completarPalabra := nil;
lista := nil;
for palabra in vocabulario do begin
if (esPrefijo(prefijo, palabra)) then begin
if (lista <> nil) then begin
new(proxima);
lista^.sig := proxima;
lista := proxima;
end
else begin
new(lista);
completarPalabra := lista;
end;
lista^.info := palabra;
end;
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment