Card Deck and Shuffle
How to create a virtual card deck and shuffle it.
While I was creating my black jack game I wanted to make the user
feel like they were using an actual deck of cards. To make this
illusion even more accurate I decided that I would have the computer
keep track of which cards had been used and after all cards had been
used I wanted the deck to be shuffled. Therefore I had to figure out a easy
way to shuffle the deck. That is how I came up with the following method:
First I made an image control array called imgCards that went from
1 to 52. In this array I filled slot (1) with the ace of clubs, slot (2) with
the two of clubs, and so on I continued this process until I had all 52 cards
put into their corresponding slots. This would make the array look like this: