{"id":25176839,"url":"https://github.com/bungogood/staffa","last_synced_at":"2025-10-25T07:40:24.069Z","repository":{"id":197419780,"uuid":"658485374","full_name":"bungogood/staffa","owner":"bungogood","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-07T18:14:22.000Z","size":159,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T13:18:38.478Z","etag":null,"topics":["backgammon","boardgame","hypergammon","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/bungogood.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}},"created_at":"2023-06-25T22:01:38.000Z","updated_at":"2023-10-21T17:36:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"966f101e-46cc-456a-ab42-a9c59da2380d","html_url":"https://github.com/bungogood/staffa","commit_stats":null,"previous_names":["bungogood/staffa"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bungogood%2Fstaffa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bungogood%2Fstaffa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bungogood%2Fstaffa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bungogood%2Fstaffa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bungogood","download_url":"https://codeload.github.com/bungogood/staffa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107829,"owners_count":20884797,"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":["backgammon","boardgame","hypergammon","rust"],"created_at":"2025-02-09T13:18:41.636Z","updated_at":"2025-10-25T07:40:19.048Z","avatar_url":"https://github.com/bungogood.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Staffa\n\n[![Build](../../actions/workflows/build.yaml/badge.svg)](../../actions/workflows/build.yaml)\n\nThis project uses gnubg's [position id](https://www.gnu.org/software/gnubg/manual/gnubg.html#gnubg-tech_postionid).\n\n```\nPosition ID: 4HPwATDgc/ABMA\n┌13─14─15─16─17─18─┬───┬19─20─21─22─23─24─┬───┐\n│ X           O    │   │ O              X │   │\n│ X           O    │   │ O              X │   │\n│ X           O    │   │ O                │   │\n│ X                │   │ O                │   │\n│ X                │   │ O                │   │\n│                  │BAR│                  │OFF│\n│ O                │   │ X                │   │\n│ O                │   │ X                │   │\n│ O           X    │   │ X                │   │\n│ O           X    │   │ X              O │   │\n│ O           X    │   │ X              O │   │\n└12─11─10──9──8──7─┴───┴─6──5──4──3──2──1─┴───┘\n```\n\n## Move Generation\n\nThe move generation follows the algorithm outlined [here](https://bkgm.com/articles/Berliner/BKG-AProgramThatPlaysBackgammon/index.html#sec-III-A). To demonstrate this, we consider the starting position as white and roll (5, 4).\n\n```md\n24/20 (4)\n\n-   20/15 -\u003e 24/15\n-   13/8 -\u003e 24/20 13/8\n-   8/3 -\u003e 24/20 8/3\n    13/8 (5)\n-   13/9 -\u003e 13/9 13/8\n-   8/4 -\u003e 13/4 // duplcates\n-   6/2 -\u003e 13/8 6/2\n    13/9 (4)\n-   9/4 -\u003e 13/4 // duplcates\n-   8/3 -\u003e 13/9 8/3\n    8/3 (5)\n-   6/2 -\u003e 8/3 6/2\n    8/4 (4)\n-   8/3 -\u003e 8/4 8/3\n```\n\n## GNU Backgammon\n\nAttached to this project is docker image which runs gnubg, this was required due to issues with installing gnubg on MacOS. Simply run:\n\n```bash\ndocker build -t gnubg .\ndocker run --rm -it gnubg\n```\n\nThis allows access to GNU Backgammons command line, simply type `help` for more infromation.\n\n## References\n\n-   [GNU Backgammon](https://www.gnu.org/software/gnubg/)\n-   [Rules](https://usbgf.org/backgammon-basics-how-to-play/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbungogood%2Fstaffa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbungogood%2Fstaffa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbungogood%2Fstaffa/lists"}