Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modifying a list

Status
Not open for further replies.

bise

Programmer
Feb 27, 2005
1
CA
hi
I am new to prolog. I have a problem in which I have a list of items[a,b,c,d,e,f,g]. Now say each item has its own category a b,d are all cat 1 items while e,g are cat 2 and c is cat 3 while f is cat 4. I want to reduce this list in such a way that it contains at most 2 items from any category which means ot of a,b,d one item has to be cut so the final list will become [a,b,c,e,f,g]. How would I do that in prolog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top