Advertisement
SRD

parts

SRD
Aug 25th, 2016
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.62 KB | None | 0 0
  1. /* Minor is being instantiated as '1001' whereas I need it to be a number.However, I'm having trouble using atom_number in this rule and am wondering how else to do this. */
  2.  
  3. query_verse(Request) :-
  4.     member(method(post), Request), !,
  5.     http_read_data(Request, Data, []),
  6.     format('Content-type: text/html~n~n', []),
  7.     format('<p>', []),
  8.     memberchk(model=Model, Data),
  9.     memberchk(minor=Minor, Data),
  10.     findall(p(Model, Major, Minor, Desc),
  11.         part(Model, Major, Minor, Desc), Descriptions),
  12.     maplist(desc, Descriptions),
  13.     format('</p>').
  14.  
  15. desc(p(M,A,I,D)) :- format("~q ~q:~q - ~q</br>", [M,A.I.D]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement