扑克牌代码
谁有扑克牌的代码???
http://iranshao.com/albums/4918578
http://iranshao.com/photos/PU9E8QemcWmn
http://iranshao.com/albums/4918585
http://iranshao.com/photos/VFGNWQLUlvHV
http://iranshao.com/albums/4918582
http://iranshao.com/photos/E7zsB5LjJZLh
http://iranshao.com/albums/4918583
http://iranshao.com/photos/pnmU3010VN3p
http://iranshao.com/albums/4918579
http://iranshao.com/photos/knTvQBDHBOCC
http://iranshao.com/albums/4918581
http://iranshao.com/photos/Jfs6EIgpoGs7
http://iranshao.com/albums/4918588
http://iranshao.com/photos/Hza2e-Kutr8z
http://iranshao.com/albums/4918592
http://iranshao.com/photos/Awr8cc6w_4Ry
http://iranshao.com/albums/4918595
http://iranshao.com/photos/kr4IEvVomfI7
http://iranshao.com/albums/4918596
http://iranshao.com/photos/qtktmNU8Jo1W
@Override
public int compareTo(Puke o) {
if(!num.equals(o.num)){
if(num.equals("A"))
return 1;
if(num.equals("K") && o.num.equals("A"))
return -1;
if(num.equals("Q") && (o.num.equals("K") || o.num.equals("A")))
return -1;
if(num.equals("J") && (o.num.equals("A") || o.num.equals("K") || o.num.equals("Q")))
return -1;
if(num.equals("10") && ((o.num.equals("A") || o.num.equals("K") || o.num.equals("Q") || o.num.equals("J"))))
return -1;
if(num.equals("A") || num.equals("K") || num.equals("Q") || num.equals("J") || num.equals("10") )
return 1;
return num.compareTo(o.num);
}
if(huase.equals("方片"))
return -1;
else if(huase.equals("黑桃"))
return 1;
else if(huase.equals("梅花") && o.huase.equals("方片"))
return 1;
return -1;
}
这是我重写的compare方法,好像有用
举报