Generating a Deck of Cards

前端 未结 12 916
暖寄归人
暖寄归人 2020-12-09 06:20

I\'m trying to make a simple blackjack program. Sadly, I\'m having problems right off the bat with generating a deck of cards.

#include 
#inc         


        
12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-09 07:11

    I think what you are looking to use is an enumeration. It will make your code clearer and resolve your problem.

    enum SUIT { HEART, CLUB, DIAMOND, SPADE }; 
    enum VALUE { ONE, TWO, THREE, ..., TEN, JACK, QUEEN, KING};
    

提交回复
热议问题