{"id":13804601,"url":"https://github.com/andy5995/zigdeck","last_synced_at":"2025-04-10T18:31:48.779Z","repository":{"id":227036726,"uuid":"770248988","full_name":"andy5995/zigdeck","owner":"andy5995","description":"A library that creates and shuffles a deck of cards from which you can draw","archived":false,"fork":false,"pushed_at":"2024-10-24T01:42:26.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"trunk","last_synced_at":"2025-04-04T03:31:48.000Z","etag":null,"topics":["cards","library","mit-license","simulation","zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/andy5995.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":"2024-03-11T08:10:46.000Z","updated_at":"2025-03-18T11:36:40.000Z","dependencies_parsed_at":"2024-06-19T03:02:35.768Z","dependency_job_id":"88039c98-46df-4579-be17-86be3641c98c","html_url":"https://github.com/andy5995/zigdeck","commit_stats":null,"previous_names":["andy5995/zigdeck"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy5995%2Fzigdeck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy5995%2Fzigdeck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy5995%2Fzigdeck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andy5995%2Fzigdeck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andy5995","download_url":"https://codeload.github.com/andy5995/zigdeck/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271784,"owners_count":21075800,"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":["cards","library","mit-license","simulation","zig","zig-library","zig-package"],"created_at":"2024-08-04T01:00:51.050Z","updated_at":"2025-04-10T18:31:48.739Z","avatar_url":"https://github.com/andy5995.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Linux CI](https://github.com/andy5995/zigdeck/actions/workflows/linux.yml/badge.svg)](https://github.com/andy5995/zigdeck/actions/workflows/linux.yml)\n\n# zigdeck\n\nA library that creates and shuffles a deck of cards from which you can draw\n\nTested with the the development version of [zig](https://ziglang.org/) (may\nnot build with the last release).\n\n## Example\n\n```zig\n    // initialize the deck. This must be done before shuffle.\n    var deck = Deck.init();\n\n    try std.testing.expectEqual(Suit.Clubs, deck.cards[0].suit);\n    try std.testing.expectEqual(Face.Ace, deck.cards[0].face);\n    try std.testing.expectEqual(Suit.Spades, deck.cards[48].suit);\n    try std.testing.expectEqual(Face.King, deck.cards[51].face);\n\n    // Seed the random number generator\n    var rng = std.rand.DefaultPrng.init(@as(u64, @intCast(std.time.milliTimestamp())));\n\n    // Shuffle\n    Deck.shuffle(\u0026deck, \u0026rng.random());\n\n    // Draw one card\n    const card = Deck.getTopCard(\u0026deck) orelse return;\n\n    try std.testing.expectEqual(Suit.Clubs, card.suit);\n    try std.testing.expectEqual(Face.Queen, card.face);\n\n    std.debug.print(\"Top card: Suit = {}, Value = {}\\n\", .{ card.suit, card.face });\n```\n\nThis library is used by [zigpokerhands](https://github.com/andy5995/zigpokerhands).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy5995%2Fzigdeck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandy5995%2Fzigdeck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandy5995%2Fzigdeck/lists"}