Last active
November 12, 2019 04:42
-
-
Save migueldiab/35bd890344086e24471eb9fece7b4ab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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