Swift Package Index


Swift library for creating applications with dominoes.


  • The latest stable release is 1.5.0. Released 3 years ago.
  • The last commit to master was 4 months ago.

Swift Version Compatibility

  • 1.5.0 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 1.5.0 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

DominoKit

Build Status Version License

Summary

DominoKit is a Swift library for creating applications with dominoes.

Installation

Cocoapods

Create a Podfile and add DominoKit.

target 'YourApp' do
    pod 'DominoKit'
end

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 Apache 2.0 license. See the LICENSE file for more info.