{"id":18950825,"url":"https://github.com/whywaita/poker-go","last_synced_at":"2025-07-27T03:05:54.940Z","repository":{"id":153394448,"uuid":"627565571","full_name":"whywaita/poker-go","owner":"whywaita","description":"poker-go is a library for playing poker (NLH) in Go.","archived":false,"fork":false,"pushed_at":"2024-01-28T18:16:19.000Z","size":1373,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-25T15:49:19.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/whywaita.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}},"created_at":"2023-04-13T18:23:39.000Z","updated_at":"2025-05-08T05:46:53.000Z","dependencies_parsed_at":"2024-01-21T06:31:50.717Z","dependency_job_id":"71697eec-96e2-481a-967e-e9185bf72e91","html_url":"https://github.com/whywaita/poker-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/whywaita/poker-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fpoker-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fpoker-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fpoker-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fpoker-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whywaita","download_url":"https://codeload.github.com/whywaita/poker-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fpoker-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267293755,"owners_count":24065320,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-08T13:24:47.968Z","updated_at":"2025-07-27T03:05:54.894Z","avatar_url":"https://github.com/whywaita.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poker-go\n\npoker-go is a library for playing poker in Go.\n\n## Usage\n\n- Evaluate a hand: [./examples/eval_hand.go](./examples/eval_hand.go)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n    \"log\"\n\t\n    \"github.com/whywaita/poker-go\"\n)\n\nfunc main() {\n\th1 := []poker.Card{\n\t\t{Rank: poker.RankAce, Suit: poker.Hearts},\n\t\t{Rank: poker.RankAce, Suit: poker.Diamonds},\n\t}\n\tp1 := poker.NewPlayer(\"player1\", h1)\n\n\tboard := []poker.Card{\n\t\t{Rank: poker.RankAce, Suit: poker.Clubs},\n\t\t{Rank: poker.RankAce, Suit: poker.Spades},\n\t\t{Rank: poker.RankKing, Suit: poker.Hearts},\n\t\t{Rank: poker.RankQueen, Suit: poker.Hearts},\n\t\t{Rank: poker.RankJack, Suit: poker.Hearts},\n\t}\n\n\thandtype, cards, err := poker.Evaluate(append(p1.Hand, board...))\n\tif err != nil {\n\t\tlog.Fatalf(\"poker.Evaluate(append(%s. %s...)): %v\", p1.Hand, board, err)\n\t}\n\n\tfmt.Printf(\"handtype: %s, cards: %s\\n\", handtype, cards)\n}\n```\n\n```bash\n$ go run eval_hand.go\nhandtype: Four of a Kind, cards: [{A hearts} {A diamonds} {A clubs} {A spades} {K hearts}]\n```\n\n- Calculate an equities for a given hands: [./examples/calc_equities.go](./examples/calc_equities)\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/whywaita/poker-go\"\n)\n\nfunc main() {\n\th1 := []poker.Card{\n\t\t{Rank: poker.RankDeuce, Suit: poker.Hearts},\n\t\t{Rank: poker.RankThree, Suit: poker.Diamonds},\n\t}\n\tp1 := poker.NewPlayer(\"player1\", h1)\n\n\th2 := []poker.Card{\n\t\t{Rank: poker.RankAce, Suit: poker.Hearts},\n\t\t{Rank: poker.RankAce, Suit: poker.Diamonds},\n\t}\n\tp2 := poker.NewPlayer(\"player2\", h2)\n\n\th3 := []poker.Card{\n\t\t{Rank: poker.RankSeven, Suit: poker.Clubs},\n\t\t{Rank: poker.RankEight, Suit: poker.Clubs},\n\t}\n\tp3 := poker.NewPlayer(\"player3\", h3)\n\n\tequities, err := poker.EvaluateEquity([]poker.Player{*p1, *p2, *p3})\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to evaluate equity: %v\", err)\n\t}\n\tfmt.Printf(\"%v equity: %f, %v equity: %f, %v equity %f\\n\", h1, equities[0], h2, equities[1], h3, equities[2])\n}\n```\n\n```bash\n$ go run calc_equities.go\n[{2 hearts} {3 diamonds}] equity: 0.085326, [{A hearts} {A diamonds}] equity: 0.663249, [{7 clubs} {8 clubs}] equity 0.251425\n```\n\n- Full documents are available at [pkg.go.dev](https://pkg.go.dev/github.com/whywaita/poker-go)\n\n## LICENSE\n\nMIT License\n\n`porting_made_hand.go` and `porting_precalculated_table.go` is porting from [axross/poker](https://github.com/axross/poker).\nOnly these files are under Apache License 2.0 from the original works.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fpoker-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhywaita%2Fpoker-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fpoker-go/lists"}