Guest User

Untitled

a guest
May 27th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. :- dynamic player/2.
  2.  
  3. register(Move, _) :-
  4. sent_by(Email, Move),
  5. player(Email, Name),
  6. reply_to(Move, 'Already a player, named ~a', [Name]).
  7.  
  8. register(_, Name) :-
  9. player(Email, Name),
  10. reply_to(Move, 'Name taken by ~a', [Email]).
  11.  
  12. register(Move, Name) :-
  13. sent_by(Email, Move),
  14. assert(player(Email, Name)),
  15. reply_to(Move, 'Welcome to the game!').
Add Comment
Please, Sign In to add comment