文件名称:O5
介绍说明--下载内容均来自于网络,请自行研究使用
1,定义一个类Card,该类的对象代表一张扑克牌。要求包含三个属性:点数,花色,和大小王信息(三者均为enum类型)。要求扑克牌能比较大小,比较规则为:
a,大王最大,小王其次。
b,其他的扑克牌按点数大小来比,点数相同的按花色来比(花色从大到小的顺序是:黑桃>红桃>梅花>方块)。
2,为Card类写一个静态方法:
static TreeSet[] dispatch(int players,int reservers),要求用一副扑克牌随机的为多人发牌,并预留给定张数的底牌,返回一个TreeSet数组,保存排好序的每个玩家得到的牌,以及预留的底牌。
3,写一个主方法测试以上程序,输出每次发牌的结果。
-define a class Card, the class object represents a playing card. Requirement contains three attributes: points, color, and size of the king of information (three are enum types.) Asked to compare the size of playing cards, more rules:
a, King largest, followed by Wang.
b, other than poker size in points, points to the same than by color (color in sequence are: spades> hearts> plum> box).
2, for the Card class to write a static method:
static TreeSet [] dispatch (int players, int reservers), require more than a deck of cards for the licensing of random, and set aside a given number of sheets of the cards, return an array of TreeSet, save the sorted each player get the card, and set aside the cards.
3, write a main method to test the above procedure, the output results of each license.
a,大王最大,小王其次。
b,其他的扑克牌按点数大小来比,点数相同的按花色来比(花色从大到小的顺序是:黑桃>红桃>梅花>方块)。
2,为Card类写一个静态方法:
static TreeSet[] dispatch(int players,int reservers),要求用一副扑克牌随机的为多人发牌,并预留给定张数的底牌,返回一个TreeSet数组,保存排好序的每个玩家得到的牌,以及预留的底牌。
3,写一个主方法测试以上程序,输出每次发牌的结果。
-define a class Card, the class object represents a playing card. Requirement contains three attributes: points, color, and size of the king of information (three are enum types.) Asked to compare the size of playing cards, more rules:
a, King largest, followed by Wang.
b, other than poker size in points, points to the same than by color (color in sequence are: spades> hearts> plum> box).
2, for the Card class to write a static method:
static TreeSet [] dispatch (int players, int reservers), require more than a deck of cards for the licensing of random, and set aside a given number of sheets of the cards, return an array of TreeSet, save the sorted each player get the card, and set aside the cards.
3, write a main method to test the above procedure, the output results of each license.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
O5\Card.java
..\Color.java
..\Joker.java
..\Point.java
O5
..\Color.java
..\Joker.java
..\Point.java
O5