Original: The game ends when all cards have been used, and all books have been obtained.
Simplified: The game ends when all the cards are face up in pairs.