Skip to content

Instantly share code, notes, and snippets.

@henriquebastos
Created August 12, 2015 20:39
Show Gist options
  • Save henriquebastos/09ba98f4af5a4ca6cae3 to your computer and use it in GitHub Desktop.
Save henriquebastos/09ba98f4af5a4ca6cae3 to your computer and use it in GitHub Desktop.
def main():
deck = Deck()
assert deck
assert len(deck) == 52
assert Card(rank='2', suit='spades') == Card(rank='2', suit='spades')
assert deck[0] == Card(rank='2', suit='spades')
assert deck[:2] == [Card('2', 'spades'), Card('3', 'spades')]
assert deck[12::13] == [Card('A', 'spades'), Card('A', 'diamonds'),
Card('A', 'clubs'), Card('A', 'hearts')]
assert Card('Q', 'hearts') in Deck()
deck[0] = None; assert deck[0] is None
deck[:2] = [None, None]; assert deck[:2] == [None, None]
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment