Różnice
Różnice między wybraną wersją a wersją aktualną.
|
|
pl:prolog:pllib:list_linking_3 [2019/06/27 15:50] |
pl:prolog:pllib:list_linking_3 [2019/06/27 15:50] (aktualna) |
| ====== List linking 3 ====== |
| {{tag>lists}} |
| ===== Description ===== |
| Linking two lists of the same length. |
| |
| **Source**: Learn prolog now!, 2001, (course available on-line) |
| ===== Download ===== |
| Program source code: {{list_linking_3.pl}} |
| ===== Listing ===== |
| <code prolog> |
| combine1([],[],[]). |
| combine1([H1|T1],[H2|T2],[H1, H2|T3]):-combine1(T1,T2,T3). |
| |
| combine2([],[],[]). |
| combine2([H1|T1],[H2|T2],[[H1,H2]|T3]):-combine2(T1,T2,T3). |
| |
| combine3([],[],[]). |
| combine3([H1|T1],[H2|T2],[join(H1,H2)|T3]):-combine3(T1,T2,T3).</code> |
| ===== Comments ===== |
| |