| Neo frost (8) | ||
so i'm still newbie and i want to made an output card like that with value from As to King and i want to give the output into random card..so when i compile and run,the output can be ♠K or ♣8 or whatever random..it makes me crazy what can i do to made that card and make it random? and if there is possible i want to add sorting code to sort the card after random so i will made it 5 card at random, sorting depends to the number and the type.. the sorting of types is like this : 1.Diamond 2.Club 3.Love 4.Spade can anyone help me? | ||
|
Last edited on
|
||
| coder777 (2378) | |||||||
|
It's a matter of organization. The presentation of your card is a string:
A card is a class:
Your deck is an array of CCard:
Fort std::sort look at this: http://www.cplusplus.com/reference/algorithm/sort/ | |||||||
|
|
|||||||
| Neo frost (8) | |
| can you explain it more detail cause i still can't get it.. | |
|
|
|
| coder777 (2378) | |
| What is it that you don't get? class? array? What? Be more specific. | |
|
|
|