Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Card Game by vnkvstnk
def cards(deck, hand):
legal_cards = [(x, x+1) for x in range(deck)]
for card in sorted(hand):
if (card-1, card) in legal_cards:
legal_cards.remove( (card-1, card) )
elif (card, card+1) in legal_cards:
legal_cards.remove( (card, card+1) )
else:
return False
return True
July 3, 2019