Skip to content

Instantly share code, notes, and snippets.

@nisbus
Last active December 10, 2015 22:38
Show Gist options
  • Save nisbus/4503947 to your computer and use it in GitHub Desktop.
Save nisbus/4503947 to your computer and use it in GitHub Desktop.
This results in a list of cards and one extra element (_Gxxxx)
deal(0,_,_).
deal(NumCards,Deck,Out) :-
get_card(C,Deck,Rest),
NewNum is NumCards-1,
append(Out,[C],Result),
deal(NewNum,Rest,Result),
Out = [C|Result],!.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment