Quote: "I ended up with the blank cards and shape cards showing on top of each other"
Maybe because you didn't clear the screen before redrawing the cards? The problem could have been as simple as that.
Quote: "My code was trashed because it just didn't work."
I understand you were annoyed but you shouldn't have thrown out the code, because now we will never know why it didn't work.
There are several ways to structure a program, even a simple one like this, and I don't know how you tried to structure yours, so I can give only very general advice. One thing is sure: you need to distinguish the status before and after the card is revealed. One way to do that is to introduce a boolean variable "revealed = true/false", and do the drawing based on its current value. This is a good solution if you use a game loop that continuously updates the screen.
Another way is to make sure that the game phases always strictly follow each other, i.e. you first draw the cards face down, wait for user selection, then clear the screen and draw the cards face up. I don't have that book, but in other examples posted on the forum, I saw that it often prefers a linear program execution instead of a loop, so that's also a possibility.
Try to recreate the code you had. If you post it here, you can receive more specific advice.