====== Change element ====== {{tag>lists}} ===== Description ===== Changing one element in list to another **Source**: PROLOG str. 49 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5 ===== Download ===== Program source code: {{change_element.pl}} ===== Listing ===== zastap(_, [], _, []). zastap(X, [X|L1], Y, [Y|L2]) :- !, zastap(X, L1, Y, L2). zastap(X, [A|L1], Y, [A|L2]) :- zastap(X, L1, Y, L2). test :- zastap(malo, [lubie, malo, lodow, i, malo, smietany], duzo, L). ===== Comments =====