Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. replace(_, _, [], []).
  2. replace(O, 1, [O|T], [1|T2]) :- H = 1 replace(O, 1, T, T2).
  3. replace(O, -1, [O|T], [-1|T2]) :- H = -1 replace(O, -1, T, T2).
  4. replace(O, 1, [O|T], [0|T2]) :- H = 0 replace(O, 0, T, T2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement