{"id":17084436,"url":"https://github.com/niklasf/antichess-tree-server","last_synced_at":"2025-03-23T13:50:03.191Z","repository":{"id":139221987,"uuid":"76953836","full_name":"niklasf/antichess-tree-server","owner":"niklasf","description":"HTTP API and C library to query Watkins antichess proof tables: 1. e3 is winning for White","archived":false,"fork":false,"pushed_at":"2017-02-07T10:24:47.000Z","size":102,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-28T20:12:48.111Z","etag":null,"topics":["antichess","chess","http-api","lichess","proof-trees"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niklasf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2016-12-20T12:16:00.000Z","updated_at":"2017-03-01T20:48:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f7429df-9760-4ed6-b17f-814adc702e97","html_url":"https://github.com/niklasf/antichess-tree-server","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/niklasf%2Fantichess-tree-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Fantichess-tree-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Fantichess-tree-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklasf%2Fantichess-tree-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklasf","download_url":"https://codeload.github.com/niklasf/antichess-tree-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245111928,"owners_count":20562511,"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":["antichess","chess","http-api","lichess","proof-trees"],"created_at":"2024-10-14T13:07:13.900Z","updated_at":"2025-03-23T13:50:03.165Z","avatar_url":"https://github.com/niklasf.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Antichess solution server\n=========================\n\nHTTP API and C library to query [Watkins antichess proof tables](http://magma.maths.usyd.edu.au/~watkins/LOSING_CHESS/index.html).\nThe decompressed proof trees (4.5 GB total) are memory mapped allowing the\nserver to run on systems with as little as 128 MB RAM. Extra RAM may be used\nby the operating systems page cache for faster lookups.\n\nBuilding\n--------\n\nInstall libevent2:\n\n    apt-get install build-essential libevent-dev\n\nThen:\n\n    make\n\nUsage\n-----\n\n[Download](http://magma.maths.usyd.edu.au/~watkins/LOSING_CHESS/index.html)\nand `bunzip2` the proof tree(s):\n\n    wget https://backscattering.de/watkins/e3wins.rev.bz2  # mirror (1.1 GB)\n    bunzip2 e3wins.rev.bz2\n\nThen start the server:\n\n    ./antichess-tree-server [--verbose] [--cors] [--port 5004] e3wins.rev\n\nHTTP API\n--------\n\nCORS enabled if `--cors` was given. Provide `moves` as a GET parameter or as\nplain text in the POST body. Space or comma seperated.\n\n### `GET|POST /`\n\n```\n\u003e curl https://tablebase.lichess.org/watkins --data e2e3,c7c5,f1b5\n```\n\n```javascript\n{\n  \"game_over\": false,\n  \"moves\": [\n    {\"uci\": \"c5c4\", \"san\": \"c4\", \"nodes\": 97097576},\n    {\"uci\": \"g8h6\", \"san\": \"Nh6\", \"nodes\": 38793760},\n    {\"uci\": \"d8c7\", \"san\": \"Qc7\", \"nodes\": 29352314},\n    {\"uci\": \"g7g5\", \"san\": \"g5\", \"nodes\": 16120450},\n    {\"uci\": \"h7h5\", \"san\": \"h5\", \"nodes\": 4057183},\n    {\"uci\": \"b7b6\", \"san\": \"b6\", \"nodes\": 3781414},\n    {\"uci\": \"a7a5\", \"san\": \"a5\", \"nodes\": 2574453},\n    {\"uci\": \"e7e6\", \"san\": \"e6\", \"nodes\": 1663892},\n    {\"uci\": \"d8a5\", \"san\": \"Qa5\", \"nodes\": 1584198},\n    {\"uci\": \"f7f6\", \"san\": \"f6\", \"nodes\": 1095973},\n    {\"uci\": \"b8c6\", \"san\": \"Nc6\", \"nodes\": 687144},\n    {\"uci\": \"g8f6\", \"san\": \"Nf6\", \"nodes\": 296496},\n    {\"uci\": \"e7e5\", \"san\": \"e5\", \"nodes\": 294169},\n    {\"uci\": \"b8a6\", \"san\": \"Na6\", \"nodes\": 262343},\n    {\"uci\": \"g7g6\", \"san\": \"g6\", \"nodes\": 250949},\n    {\"uci\": \"f7f5\", \"san\": \"f5\", \"nodes\": 153818},\n    {\"uci\": \"h7h6\", \"san\": \"h6\", \"nodes\": 124882},\n    {\"uci\": \"a7a6\", \"san\": \"a6\", \"nodes\": 21336},\n    {\"uci\": \"d8b6\", \"san\": \"Qb6\", \"nodes\": 3078},\n    {\"uci\": \"d7d5\", \"san\": \"d5\", \"nodes\": 33},\n    {\"uci\": \"d7d6\", \"san\": \"d6\", \"nodes\": 31}\n  ]\n}\n```\n\nC API\n-----\n\n```c\n#include \u003cstdio.h\u003e\n#include \u003cerrno.h\u003e\n#include \u003cstring.h\u003e\n\n#include \"tree.h\"\n\nint main() {\n    tree_t tree;\n\n    if (!tree_open(\u0026tree, \"easy18.done\")) {\n        printf(\"could not open tree: %s\\n\", strerror(errno));\n        return 1;\n    }\n\n    query_result_t result;\n    query_result_clear(\u0026result);\n\n    move_t moves[] = { move_parse(\"e2e3\") };\n    size_t moves_len = 1;\n\n    if (!tree_query(\u0026tree, moves, moves_len, \u0026result)) {\n        printf(\"query failed\\n\");\n        return 1;\n    }\n\n    // Could also query other trees now. Results are merged.\n\n    query_result_sort(\u0026result);\n\n    for (size_t i = 0; i \u003c result.num_children; i++) {\n        char uci[MAX_UCI];\n        move_uci(result.moves[i], uci);\n\n        printf(\"%s %d\\n\", uci, result.sizes[i]);\n    }\n\n    return 0;\n}\n```\n\nAcknowledgements\n----------------\n\nThanks to [Mark Watkins](http://magma.maths.usyd.edu.au/~watkins/),\nBen Nye, Catalin Francu and others for solving antichess and publishing the\nproof trees.\n\nLicense\n-------\n\nLicensed under the AGPLv3+. See COPYING for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasf%2Fantichess-tree-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklasf%2Fantichess-tree-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasf%2Fantichess-tree-server/lists"}