{"id":20191465,"url":"https://github.com/leviroth/backgammon","last_synced_at":"2026-05-12T17:34:29.004Z","repository":{"id":115658713,"uuid":"89666081","full_name":"leviroth/backgammon","owner":"leviroth","description":"A networked OCaml implementation of backgammon. Try it locally: https://leviroth.github.io/backgammon/","archived":false,"fork":false,"pushed_at":"2018-06-30T12:00:35.000Z","size":530,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T18:52:47.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/leviroth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2017-04-28T04:02:15.000Z","updated_at":"2021-05-19T18:56:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"09622e7c-f9c9-4e15-9afa-7a10741c36fd","html_url":"https://github.com/leviroth/backgammon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leviroth%2Fbackgammon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leviroth%2Fbackgammon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leviroth%2Fbackgammon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leviroth%2Fbackgammon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leviroth","download_url":"https://codeload.github.com/leviroth/backgammon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629736,"owners_count":19993707,"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":[],"created_at":"2024-11-14T03:49:17.952Z","updated_at":"2026-05-12T17:34:28.973Z","avatar_url":"https://github.com/leviroth.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backgammon\n\n![backgammon](https://leviroth.github.io/backgammon/images/game.png)\n\nThis is backgammon, implemented in OCaml. The project includes three different\nfront-ends:\n\n- A networked web client - host a server and play with friends across the\n  world.\n- A standalone web app - play locally via a static web page. [Try it via\n  GitHub Pages.](https://leviroth.github.io/backgammon/)\n- A terminal app.\n\n# Installation\n\nFor the command-line interface, you will want at least Jane Street Base, stdio,\nand ppx\\_jane, installable via:\n\n```bash\nopam install base stdio ppx_jane\n```\n\nRunning tests requires `core_kernel`.\n\nFor the web interface, substantially more is needed. Unfortunately, this project\ndepends on some packages that are not yet part of the opam repository, and the\ncurrent version of opam makes it necessary to manually pin them:\n\n```bash\nopam install core async websocket-async js_of_ocaml\n# The following are either not yet published to opam, or not up to date with the\n# latest master branch bugfixes:\nopam pin add ocaml-vdom git://github.com/lexifi/ocaml-vdom.git\nopam pin add gen_js_api git://github.com/lexifi/gen_js_api.git\n```\n\n# Build and usage\n\n## Command-line interface\n\n![cli](https://leviroth.github.io/backgammon/images/cli_game.png)\n\nThe command-line interface can be built and run with:\n\n```bash\njbuilder build @cli\n_build/default/cli/main.exe\n```\n\nMoves are entered by choosing a starting location and the die that should be\nused from that position.\n\n## Web interface\n\nTo build the networked web interface, simply:\n\n```bash\njbuilder build @web\n```\n\nWe make the game playable by running the server executable, and separately\nserving static files from the `client/` build directory:\n\n```bash\n_build/default/server/main.exe\n\n# In a separate session:\ncd _build/default/client\npython3 -m http.server\n```\n\nThe game can then be accessed on whatever port is serving the web client. If\nyou want to play over the Internet, you will need to make sure that your friends\ncan access this port, as well as port 3000 which is used for WebSockets.\n\nTo build and serve the static web page:\n\n```bash\njbuilder build @standalone\ncd _build/default/client\npython3 -m http.server\n```\n\nThe page can then be accessed via http://localhost:8000/standalone.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleviroth%2Fbackgammon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleviroth%2Fbackgammon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleviroth%2Fbackgammon/lists"}