Giter Club home page Giter Club logo

classic-tdd-sibala's Introduction

「十八啦」(Sibala)

  1. 有四顆骰子,骰子的點數為 1~6
  2. 規則:
    1. 以所得點數大小與分勝負。
    2. 計點方式係先扣除2顆點數相同的骰子,其餘2顆點數合計即為其所得點數。
    3. 若有兩組骰子點數相同,則以點數較大者之合計為其所得點數。
    4. 若所擲骰子正面均不相同,稱為「無面」或「無點」,則沒有點數。
    5. 有3顆骰子相同且另一顆不同,沒有點數。
    6. 因此,所得點數最大為12點,稱為「十八」(si̍p-pat);最小為3點,漢字為「扁膣」,發音類似BG,為賭徒賭輸,生氣怒罵用語。
    7. 若四顆骰子正面均相同,稱為「一色」(外省人稱豹子),不論點數多寡,均以勝計。
    8. 若玩家們同時有多個「一色」,大小順序比較:1 > 4 > 6 > 5 > 3 > 2。
    9. 若玩家們同時有多個相同點數,以點數合中單顆最大的爲勝。
    10. 若經過上面規則玩家點數仍相同,則和局。
  3. 牌型有下列幾種(大小順序由上而下):
    1. all of a kind (一色): 四顆骰子點數一樣,如 2 2 2 2,如 6 6 6 6
      • 兩個 all of a kind 大小順序比較:1 > 4 > 6 > 5 > 3 > 2
    2. normal point: 2顆點數一樣的骰子成對,另外2顆點數和即為 sum,例如 5 3 5 4 為 7 點, 6 6 2 3 為 5 點。
      • 兩個 normal point 比較大小:若 2 顆骰子點數的和(sum) 一樣,則比較用來加總點數較大的那顆骰子點數,例如 5 5 3 4 為 4+3 等於 7 點,而 2 2 6 1 為 6+1 等於 7 點,則 2 2 6 1 > 5 5 3 4,因為 6 > 4。
    3. no point: 4 顆骰子點數都不一樣,或是 有 3 顆骰子點數一樣。
      • 兩個 no point 一樣大,平手。
  4. test cases 舉例
    1. 範例1:
      • Black: 5 3 5 4 White: 2 6 2 3
      • White win. - with normal point: 9
    2. 範例2:
      • Black: 5 5 5 5 White: 2 6 2 3
      • Black win. - with all of a kind: 5
    3. 範例3:
      • Black: 3 5 5 5 White: 4 1 4 2
      • White win. - with normal point: 3
    4. 範例4:
      • Black: 3 4 5 5 White: 4 1 4 6
      • White win. - with normal point: 7
    5. 範例5:
      • Black: 3 5 5 5 White: 4 1 3 6
      • Tie.
    6. 範例6:
      • Black: 3 6 5 5 White: 4 4 3 6
      • Tie.

classic-tdd-sibala's People

Contributors

hsuanliao avatar

Watchers

James Cloos avatar  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.