June 2015
Beginner
354 pages
8h 23m
English
Let's now imagine holding a real deck in our hand and setting up the matching game.
We would first shuffle the cards in our hands and then we would put each card on the table with the back facing up. For an easier gameplay, we align the cards into a 4 x 3 array. Now, the game is set up and we are going to play it.
We pick up one card and flip it to make it face up. We pick another one and face it upwards. Afterwards, we have two possible actions. We take away the two cards if they have the same pattern. Otherwise, we put them back facing down, as if we had not touched them. The game continues until we pair all of the cards.
The code flow will be much clearer after we have this step-by-step scenario in our mind. ...
Read now
Unlock full access