Zebra0

Learn to Program Step-by-Step

Cards

To create card games you use an array 0 to 51 (52 if you want a joker) .
Any card can be found from the numbers from 0 to 51 using
face=card%13; //a value from 0 to 12
suit=card/13; //a value from 0 to 3

If you want graphics you can use these or create your own:
Spades: Ace, 2 , 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K
Hearts: Ace, 2 , 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K
Diamonds: Ace, 2 , 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K
Clubs:
Ace, 2 , 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K
Joker1, Joker2


Like us on Facebook:



OER: Open Educational Resource
Creative Commons License Author: Janet E. Joy; Publisher: Zebra0.com
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Creative Commons Attribution-NonCommercial 4.0 International License
Last modified: March 17 2016 11:33:06.