Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- replace(_, _, [], []).
- replace(O, 1, [O|T], [1|T2]) :- H = 1 replace(O, 1, T, T2).
- replace(O, -1, [O|T], [-1|T2]) :- H = -1 replace(O, -1, T, T2).
- replace(O, 1, [O|T], [0|T2]) :- H = 0 replace(O, 0, T, T2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement