Code for card game.