If you post a code snippet, ALWAYS USE CODE TAGS:
How to use code tags: Using code tags properly
What you seek to do is just dealing cards from a shuffled deck. Check out card / deck shuffle tutorials for the basics. You make a list, shuffle it, then either:
- take the first item and remove it once used
OR
- take the next item starting from 0 to max - 1