Guest User

Untitled

a guest
Jun 21st, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. /**
  2. * "with" solution, Jekejeke Prolog version.
  3. *
  4. * Copyright 2018, XLOG Technologies GmbH, Switzerland
  5. * Jekejeke Prolog 1.2.7 (a fast and small prolog interpreter)
  6. */
  7.  
  8. :- module(colorpoint, [invert/2]).
  9. :- reexport(point).
  10.  
  11. invert(Self, New) :-
  12. arg(3, Self, _C_),
  13. C is 255 - _C_,
  14. Self::with_color(C, New).
  15.  
  16. with_color(colorpoint(X,Y,_), C, colorpoint(X,Y,C)).
  17.  
  18. :- override with_position/4.
  19. with_position(colorpoint(_,_,C), X, Y, colorpoint(X,Y,C)).
Add Comment
Please, Sign In to add comment