扑克牌代码

来源:7-1 简易扑克牌游戏

井上春子

2016-09-16 23:29

谁有扑克牌的代码???

写回答 关注

3回答

  • 慕设计9479289
    2021-08-19 21:43:08

    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


  • 慕粉1472426630
    2016-09-21 15:01:50

    @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方法,好像有用

  • REN_BIN
    2016-09-17 16:38:17

    http://www.imooc.com/opus/resource?opus_id=3402

Java入门第三季

Java中你必须懂得常用技能,不容错过的精彩,快来加入吧

409792 学习 · 4340 问题

查看课程

相似问题