GithubHelp home page GithubHelp logo

texas's Introduction

Texas

一副扑克有52张牌,每张牌由一个花色和一个数字构成。

花色为以下四者之一:

    方片 D 
    黑桃 S
    红桃 H
    梅花 C

数字为以下13者之一,且大小顺序如下:

    2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K, A

花色是大小无序的,但数字有序,2最小,A最大。

一手牌有5张。根据花色和数字的不同,其大小按照以下规则决定。

满足下面规则的手牌会大于满足上面规则的手牌。

    同花顺>铁支>葫芦>同花>顺子>三条>两对>对子>散牌
  1. 散牌:

     不符合其他任何规则的五张牌。
     比较最大一张牌的大小,如果相同,比较第二大的牌的牌点数,如果五张牌的牌点数都相同,则为平局。
    
  2. 对子:

     有两张同样大小的牌片。
     比较两张大小一样的牌的牌点数,如果相同,依次比较剩余的三张牌大小。若大小都相同,则为平局。
    
  3. 两对:

     有两个对子牌。
     比较大对子的大小,若相同,比较小对子的大小,若还相同,比较单张牌的大小,若还相同,则为平局。
    
  4. 三条:

     有三张同样大小的牌片。
     比较三张大小一样的牌的牌点数大小。
    
  5. 顺子:

     五张相连的牌。
     比较最大的牌点数。若大小都相同,则为平局。
    
  6. 同花:

     五张牌的花色相同。
     按照散排规则比较大小。
    
  7. 葫芦:

     三条+对子。
     比较三张大小一样的牌的牌点数。
    
  8. 铁支:

     有四张同样大小的牌片。
     比较四张大小一样的牌的牌点数。
    
  9. 同花顺:

     同一种花色的顺子。
     比较最大的牌的牌的大小。若大小都相同,则为平局。
    

你的工作是为两手牌判断大小。

例如:

输入: Black: 2H 3D 5S 9C KD White: 2C 3H 4S 8C AH 输出: White wins

输入: Black: 2H 4S 4C 2D 4H White: 2S 8S AS QS 3S 输出: Black wins

输入: Black: 2H 3D 5S 9C KD White: 2C 3H 4S 8C KH 输出: Black wins

texas's People

Contributors

jinhelen avatar smile836 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.