Skip to content

Instantly share code, notes, and snippets.

@jkutner
Created December 6, 2010 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkutner/729766 to your computer and use it in GitHub Desktop.
Save jkutner/729766 to your computer and use it in GitHub Desktop.
decks_with_n_of([A|SetOfDecks], N, Max, SetOfDecksWithMaxAtN) :-
\+ nth_score(N, A, Max),
decks_with_n_of(SetOfDecks, N, Max, SetOfDecksWithMaxAtN).
decks_with_n_of([A|SetOfDecks], N, Max, SetOfDecksWithMaxAtN) :-
nth_score(N, A, Max),
decks_with_n_of(SetOfDecks, N, Max, R),
append([A], R, SetOfDecksWithMaxAtN).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment