Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * "with" solution, Jekejeke Prolog version.
- *
- * Copyright 2018, XLOG Technologies GmbH, Switzerland
- * Jekejeke Prolog 1.2.7 (a fast and small prolog interpreter)
- */
- :- module(colorpoint, [invert/2]).
- :- reexport(point).
- invert(Self, New) :-
- arg(3, Self, _C_),
- C is 255 - _C_,
- Self::with_color(C, New).
- with_color(colorpoint(X,Y,_), C, colorpoint(X,Y,C)).
- :- override with_position/4.
- with_position(colorpoint(_,_,C), X, Y, colorpoint(X,Y,C)).
Add Comment
Please, Sign In to add comment