{"id":15648455,"url":"https://github.com/daniel-beard/swiftpokerhands","last_synced_at":"2025-07-18T14:42:51.377Z","repository":{"id":148525911,"uuid":"41971956","full_name":"daniel-beard/SwiftPokerHands","owner":"daniel-beard","description":"A simple five card poker hand classifier","archived":false,"fork":false,"pushed_at":"2021-05-08T18:27:49.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T01:27:52.705Z","etag":null,"topics":["classifier","poker","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel-beard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-05T18:51:24.000Z","updated_at":"2021-05-08T18:27:51.000Z","dependencies_parsed_at":"2023-05-20T10:00:37.688Z","dependency_job_id":null,"html_url":"https://github.com/daniel-beard/SwiftPokerHands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2FSwiftPokerHands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2FSwiftPokerHands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2FSwiftPokerHands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-beard%2FSwiftPokerHands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-beard","download_url":"https://codeload.github.com/daniel-beard/SwiftPokerHands/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258862,"owners_count":20748573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classifier","poker","swift"],"created_at":"2024-10-03T12:24:53.924Z","updated_at":"2025-03-29T23:41:09.165Z","avatar_url":"https://github.com/daniel-beard.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftPokerHands ![](https://img.shields.io/badge/swift-5-brightgreen.svg)\n\nA simple five card poker hand classifier\n\n### Examples:\n\n##### Identifying a hand rank\n\n```swift\nlet cards = [\n    Card(rank: .four,  suit: .hearts),\n    Card(rank: .five,  suit: .diamonds),\n    Card(rank: .six,   suit: .clubs),\n    Card(rank: .seven, suit: .spades),\n    Card(rank: .eight, suit: .hearts),\n]\nlet hand = PokerHand(cards: cards)\nprint(hand.handRank()) // straight\n```\n\n##### Comparing two hands\n\n```swift\nlet cards = [\n    Card(rank: .four,  suit: .hearts),\n    Card(rank: .four,  suit: .diamonds),\n    Card(rank: .five,  suit: .hearts),\n    Card(rank: .five,  suit: .hearts),\n    Card(rank: .six,   suit: .hearts),\n]\nlet cards2 = [\n    Card(rank: .five,  suit: .hearts),\n    Card(rank: .five,  suit: .hearts),\n    Card(rank: .seven, suit: .hearts),\n    Card(rank: .six,   suit: .hearts),\n    Card(rank: .six,   suit: .clubs),\n]\nlet hand = PokerHand(cards: cards)\nlet hand2 = PokerHand(cards: cards2)\n\nprint(hand \u003c hand2) // true\n```\n\n##### Other Examples\n\n```swift\nlet cards = [\n    Card(rank: .four,   suit: .hearts),\n    Card(rank: .four,   suit: .diamonds),\n    Card(rank: .five,   suit: .hearts),\n    Card(rank: .five,   suit: .hearts),\n    Card(rank: .six,    suit: .hearts),\n]\nlet cards2 = [\n    Card(rank: .five,   suit: .hearts),\n    Card(rank: .five,   suit: .hearts),\n    Card(rank: .seven,  suit: .hearts),\n    Card(rank: .six,    suit: .hearts),\n    Card(rank: .six,    suit: .clubs),\n]\nlet cards3 = [\n    Card(rank: .four,   suit: .hearts),\n    Card(rank: .five,   suit: .diamonds),\n    Card(rank: .six,    suit: .clubs),\n    Card(rank: .seven,  suit: .spades),\n    Card(rank: .eight,  suit: .hearts),\n]\nlet hand = PokerHand(cards: cards)\nlet hand2 = PokerHand(cards: cards2)\nlet hand3 = PokerHand(cards: cards3)\n\nprint(hand \u003c hand2) // true\nprint(hand2.handRank()) // twoPair\n\nprint(hand.suits) // [Suit.diamonds: 1, Suit.hearts: 4]\nprint(hand.handRank()) // twoPair\nprint(hand3.handRank()) // straight\n```\n\n### License \nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-beard%2Fswiftpokerhands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-beard%2Fswiftpokerhands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-beard%2Fswiftpokerhands/lists"}