{"id":18952618,"url":"https://github.com/jdan/combinatorial-games","last_synced_at":"2026-03-29T12:30:20.377Z","repository":{"id":145189495,"uuid":"387235685","full_name":"jdan/combinatorial-games","owner":"jdan","description":"An exploration of evaluating the results of games without chance (Nim, Tic-Tac-Toe) under perfect play.","archived":false,"fork":false,"pushed_at":"2021-07-19T16:54:41.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-01T02:41:37.677Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-07-18T17:45:39.000Z","updated_at":"2023-09-14T22:02:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba2a5188-054f-42e9-adb8-59974c729f43","html_url":"https://github.com/jdan/combinatorial-games","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcombinatorial-games","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcombinatorial-games/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcombinatorial-games/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdan%2Fcombinatorial-games/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdan","download_url":"https://codeload.github.com/jdan/combinatorial-games/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"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-08T13:34:08.262Z","updated_at":"2026-03-29T12:30:20.319Z","avatar_url":"https://github.com/jdan.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"## combinatorial-games\n\nAn exploration of evaluating the results of [games without chance](https://en.wikipedia.org/wiki/Combinatorial_game_theory) under perfect play. [game.ml](/lib/game.ml) contains all the code.\n\nInspired by [Jordan Ellenberg's novel, Shape](https://amzn.to/3yKptm0) (Chapter 5: _\"His Style Was Invincibility\"_)\n\n### example\n\n```ocaml\nlet%test_module _ = (module struct\n  module M = CombinatorialGameEvaluator(TicTacToe)\n\n  let%test \"An empty board is a Draw\" =\n    Draw = M.eval { xs_turn = true;\n                    board = (Empty, Empty, Empty,\n                             Empty, Empty, Empty,\n                             Empty, Empty, Empty)\n                  }\n\n  let%test \"O can force a draw even if X plays correctly\" =\n    Draw = M.eval { xs_turn = false;\n                    board = (X, Empty, Empty,\n                             Empty, Empty, Empty,\n                             Empty, Empty, Empty)\n                  }\n\n  let%test \"O playing top-right is a fatal error\" =\n    Win = M.eval { xs_turn = true;\n                   board = (X, Empty, O,\n                            Empty, Empty, Empty,\n                            Empty, Empty, Empty)\n                 }\nend)\n```\n\n### running\n\ntests\n\n```\n$ dune runtest\n```\n\nmain executable (show a game of [Hare and Hounds](https://en.wikipedia.org/wiki/Hare_games#Hare_and_Hounds))\n\n```\n$ dune exec bin/main.exe\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fcombinatorial-games","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdan%2Fcombinatorial-games","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdan%2Fcombinatorial-games/lists"}