{"id":21657022,"url":"https://github.com/tmthyln/mahjongtiles.jl","last_synced_at":"2025-03-20T05:18:19.027Z","repository":{"id":61798686,"uuid":"451299823","full_name":"tmthyln/MahjongTiles.jl","owner":"tmthyln","description":"Basic utilities for working with Mahjong tiles and games","archived":false,"fork":false,"pushed_at":"2022-12-25T05:53:52.000Z","size":363,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T19:56:58.321Z","etag":null,"topics":["games","julia","mahjong"],"latest_commit_sha":null,"homepage":"https://tmthyln.github.io/MahjongTiles.jl/latest/","language":"Julia","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/tmthyln.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}},"created_at":"2022-01-24T03:12:09.000Z","updated_at":"2022-04-16T13:11:55.000Z","dependencies_parsed_at":"2022-10-21T11:15:31.175Z","dependency_job_id":null,"html_url":"https://github.com/tmthyln/MahjongTiles.jl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmthyln%2FMahjongTiles.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmthyln%2FMahjongTiles.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmthyln%2FMahjongTiles.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmthyln%2FMahjongTiles.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmthyln","download_url":"https://codeload.github.com/tmthyln/MahjongTiles.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554120,"owners_count":20471173,"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":["games","julia","mahjong"],"created_at":"2024-11-25T09:18:59.719Z","updated_at":"2025-03-20T05:18:19.002Z","avatar_url":"https://github.com/tmthyln.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MahjongTiles.jl\n\n[![Documentation](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/docs.yml/badge.svg)](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/docs.yml)\n[![Unit Tests](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/tests.yml/badge.svg)](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/tests.yml)\n[![Nightly Tests](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/nightly.yml/badge.svg)](https://github.com/tmthyln/MahjongTiles.jl/actions/workflows/nightly.yml)\n\nBasic utilities for representing and working with Mahjong tiles, hands, and decks\n(works in a similar way to \n[PlayingCards.jl](https://juliahub.com/ui/Packages/PlayingCards/I6MLG/0.3.0)).\n\nTo get started, you can install from the Julia General repository in the usual way:\n\n```julia\n(env) pkg\u003e add MahjongTiles\n```\n\nSee the [full documentation](https://tmthyln.github.io/MahjongTiles.jl/latest/) for more details.\n\n## Components\n\n### Tiles\n\nEach of the 42 unique standard tiles is represented as a object.\nTo access an individual tile, you can reference the \"symbolic\" constants\nthat are exported by the package:\n\n```julia\njulia\u003e using MahjongTiles\n\njulia\u003e 🀛\n🀛\n\njulia\u003e 🀥\n🀥\n```\n\nHowever, it's hard to type these out without already knowing how to type them,\nso there are a few convenience functions that can create specific tiles:\n\n```julia\njulia\u003e using MahjongTiles: character, season, wind, dragon\n\njulia\u003e character(3)\n🀉\n\njulia\u003e season(4)\n🀩\n\njulia\u003e wind(2)\n🀁\n\njulia\u003e dragon(1) == dragon(:red)\n🀄\n```\n\n\n### Decks\n\nDepending on the specific variety of Mahjong being played,\na deck is composed of 4 of each tile from the 3 standard \"suits\",\nplus 4 of each of the winds, 4 of each of the dragons, and \nsometimes the 8 flowers/seasons.\nIn the code, these are called `TilePile`s. \nThe easiest way to create one is to just use the standard constructor:\n\n```julia\nusing MahjongTiles: TilePile\n\ndeck = TilePile(:standard)\n```\n\n### Hands\n\nAgain, depending on the specific variety being played, \na hand is usually composed of 13+1 or 16+1 tiles from a game deck.\n\nThere are also functions to test if hands contain certain arrangements;\nthese are used to count points \n(for gambling, sure, but also for bragging rights).\n\n\n## Related\n\nThere's also a similar project [MahjongEnvironment](https://github.com/coldinjection/MahjongEnvironment);\nhowever, this package differs in\n- more broad scope beyond just reinforcement learning\n- registered\n- supporting different variants of Mahjong in a more general way\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmthyln%2Fmahjongtiles.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmthyln%2Fmahjongtiles.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmthyln%2Fmahjongtiles.jl/lists"}