cribbage-api-ios 1.0.0

cribbage-api-ios 1.0.0

测试已测试
语言编程语言 Obj-CObjective C
许可证 MIT
发布日期最新版本发布日期2014年12月

Alan Rahlf 维护。



  • arahlf

摘要

CribbageAPI 是一个用于计分 Cribbage 手牌的简单工具。

示例使用

#import "CribbageAPI.h"

NSArray *hand = @[FOUR_OF_SPADES, FIVE_OF_DIAMONDS, FIVE_OF_CLUBS, SIX_OF_HEARTS];

NSArray *scores = [CribbageAPI scoreHand:hand cut:TWO_OF_DIAMONDS crib:NO];

for (Score *score in scores) {
    NSLog(@"%@ - %@", score.displayName, score.cards);
}

/*
Outputs:

Pair for 2 - (
    "<Five of Diamonds>",
    "<Five of Clubs>"
)
Double run of three for 6 - (
    "<Four of Spades>",
    "<Five of Diamonds>",
    "<Five of Clubs>",
    "<Six of Hearts>"
)
Fifteen for 2 - (
    "<Four of Spades>",
    "<Five of Diamonds>",
    "<Six of Hearts>"
)
Fifteen for 2 - (
    "<Four of Spades>",
    "<Five of Clubs>",
    "<Six of Hearts>"
)
*/