CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

DominoKit 1.5.0

DominoKit 1.5.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 4.0.3
SPMSupports SPM

Maintained by Jarrod Parkes.



DominoKit 1.5.0

DominoKit

Summary

DominoKit is a Swift library for creating applications with dominoes.

Installation

Swift Package Manager

Using the Swift Package Manager, ensure DominoKit is included in the dependencies section of Package.swift:

let package = Package(
    name: "MyProject",
    dependencies: [
        .Package(url: "https://github.com/jarrodparkes/DominoKit.git", majorVersion: 1),
    ]
)

Usage

import DominoKit

let sixEight = Domino(suitOne: .six, suitTwo: .eight)
print(sixEight) // "[06|08]"
print(sixEight.suitOne) // "06"
print(sixEight.suitTwo) // "08"
print(sixEight.isDouble) // false
print(sixEight.isSingle) // true
print(sixEight.rank) // 14
print(sixEight.hasMatchingSuit(.six)) // true

let oneFive: Domino = "[01|05]"
print(oneFive.rank) // 6

let doubleNineSet = DominoSet.standardSet(.nine)
doubleNineSet.shuffle()
if let randomDomino = doubleNineSet.deal() {
    print(randomDomino) // domino between "[00|00]" and "[09|09]"
}

License

DominoKit is available under the MIT license. See the LICENSE file for more info.