Advertisement
logicmoo

is_packed

Dec 3rd, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.30 KB | None | 0 0
  1. is_packed(List):-is_packed(List,[]).
  2.  
  3. is_packed([],_).  
  4. is_packed([XNow,XNow|TODO],WhatIWontAllowoAgainList):- is_packed([XNow|TODO],WhatIWontAllowoAgainList).  
  5. is_packed([XNow|TODO],WhatIWontAllowoAgainList):- \+ member(XNow,WhatIWontAllowoAgainList), is_packed(TODO,[XNow|WhatIWontAllowoAgainList]).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement