Skip to content

Instantly share code, notes, and snippets.

@JDevlieghere
Last active December 11, 2015 11:38
Show Gist options
  • Save JDevlieghere/4595295 to your computer and use it in GitHub Desktop.
Save JDevlieghere/4595295 to your computer and use it in GitHub Desktop.
partition([],_,[]).
partition(List,Size,[Team|Teams]):-
team(List,Size,Team),
findall(X,(member(X,List),\+member(X,Team)),Overige),
partition(Overige,Size,Teams).
team(_,0,[]).
team(List,Size,[R|Team]):-
Size > 0,
T is Size - 1,
team(List,T,Team),
member(R,List),
\+ member(R,Team).
lol(0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment