Last active
February 20, 2017 21:20
-
-
Save JayBazuzi/aa1a17188812f640eba4d94495de892e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<Card> cards = ... | |
for (i = 0; i < cards.length(); i++) | |
{ | |
Assert(card[i].value == i % 13); | |
Assert(card[i].suit == i / 13); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<Card> cards = ... | |
AssertSorted(cards, | |
[](auto& _) { return _.value; }, | |
[](auto& _) { return _.suit; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<Card> cards = ... | |
AssertCardsSortedLikeANewBox(cards); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DeckOfCards cards = ... | |
Assert(cards.AreSortedLikeANewBox()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment