Download code

Jump to: navigation, search

Back to Adding_vectors_(Prolog)

Download for Windows: single file, zip

Download for UNIX: single file, zip, tar.gz, tar.bz2

vector_addition.pl

1 vadd([], [], []).
2 vadd([H1|T1], [H2|T2], [H3|T3]) :-
3     H3 is H1 + H2,
4     vadd(T1, T2, T3).
5