deck-of-cards

所属分类:Windows编程
开发工具:Visual C++
文件大小:2KB
下载次数:31
上传日期:2013-05-12 08:26:32
上 传 者jmrzzw
说明:  编写一个洗牌和发牌的程序,包含类Card, 类DeckOfCards和一个驱动程序 类Card有: a) int型的数据成员face和suit b) 接受两个int型数据表示面值和花色的构造函数用于初始化数据 c) 两个string类型的static数组代表面值和花色 d) 一个toString函数返回Card,形式是“face of suit”的字符串。可以用+运算符连接字符串 类DeckOfCards有: a) 一个名为deck的Card类vector,用于存储Card b) 代表下一个将要处理的牌的整型值currentCard c) 一个用来初始化deck中的Card的默认构造函数。构造函数使用vector的函数push_back将产生的牌添加到vector的末尾。这个过程对于deck的52张牌都要做一遍 d) 函数shuffle用于洗牌。洗牌算法应该在vector中反复做。对于每张牌,随机选取另一张牌,然后交换这两张牌 e) dealCard函数返回下一张牌 f) moreCards函数返回一个bool值,代表是否还有牌要处理 驱动程序产生DeckOfCards对象,洗牌,然后发牌。
(英语中文(简体)日语Write a reshuffle and licensing program, containing the class Card class DeckOfCards and a driver Class Card: a) int type data members face and suit b) accept two int type data amount and color of the constructor is used to initialize data c) both the static array representing the par value of the string type and color d) a toString function returns the Card, the form of the "face of suit" string. You can use the+ operator connection string Class DeckOfCards: a) a named deck Card class vector for storage Card b) represents the next card to be processed integer value currentCard c) a Card in the default constructor is used to initialize the deck. The constructor uses the vector function push_back card added to the end of the vector. This process for a deck of 52 cards have to do it again d) function is used to shuffle shuffle. The shuffling algorithm should be repeatedly done in the vector. Randomly selected for each card, another card, and then exchange these two ca)

文件列表:
deck of cards (0, 2013-04-21)
deck of cards\Card.cpp (398, 2013-04-17)
deck of cards\Card.h (291, 2013-04-17)
deck of cards\DeckOfCards.cpp (1047, 2013-04-17)
deck of cards\DeckOfCards.h (325, 2013-04-17)
deck of cards\main.cpp (197, 2013-04-17)

近期下载者

相关文件


收藏者