
This page is referencing code from the Blackjack Project so to fully understand some aspects you should head over to that page and watch the video of the game being played.
The code shown above and below is that of a simple switch case which will link a value to each image/card. What this means is we can give the 4 cards suits with number of 2 for example a value of 2 if its drawn from the deck. We have to do this with each card in the deck.

After all images 0-51 (since we count 0 as 1) are giving a value in the switch case, we can break out of the case and return the value. We also have a default value of 0 set.
Below you can see the image list mentioned with all the cards in an order (2s, 3s, 4s etc...). Its essential that they are ordered to suit your switch case, failure to do so will result in wrong values for different cards.
Carrying on from this we can add a randomiser to the "cardValue" variable shown in the second image which will give the player a random card with the correct value.
