{"id":21900717,"url":"https://github.com/nwrenger/hadar","last_synced_at":"2025-03-22T06:12:34.110Z","repository":{"id":219517007,"uuid":"749189071","full_name":"nwrenger/hadar","owner":"nwrenger","description":"The current code of Hunger of Hadar","archived":false,"fork":false,"pushed_at":"2024-07-01T19:31:22.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T16:38:49.724Z","etag":null,"topics":["astar","battlesnake","hungry"],"latest_commit_sha":null,"homepage":"https://play.battlesnake.com/profile/nwrenger","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/nwrenger.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":"2024-01-27T20:37:14.000Z","updated_at":"2024-07-01T19:31:24.000Z","dependencies_parsed_at":"2024-03-26T02:45:33.969Z","dependency_job_id":null,"html_url":"https://github.com/nwrenger/hadar","commit_stats":null,"previous_names":["nwrenger/hadar"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwrenger%2Fhadar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwrenger%2Fhadar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwrenger%2Fhadar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwrenger%2Fhadar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwrenger","download_url":"https://codeload.github.com/nwrenger/hadar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244913331,"owners_count":20530817,"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":["astar","battlesnake","hungry"],"created_at":"2024-11-28T15:09:42.307Z","updated_at":"2025-03-22T06:12:34.093Z","avatar_url":"https://github.com/nwrenger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hadar\n\nThis crate contains some simple battlesnake agents. The structure of this project is forked from [this crate](https://github.com/wrenger/snork/).\n\n## Usage\n\n### Running the Server\n\nFirst, the rust toolchain has to be installed (https://www.rust-lang.org/learn/get-started).\n\nStarting the server:\n\n```bash\ncargo run --release --bin server -- [-h] [--host \u003cip:port\u003e] [--config \u003cjson\u003e]\n```\n\n\u003e There are additional options for `--runtime` and visual representation of the snake (`--head`, `--tail`, `--color`).\n\u003e Run `cargo run --release --bin server -- -h` to see all the commandline options.\n\n`config` defines the agent to be used (`AStar`, `Random`) and configures the agent's heuristic.\nThe default config for the `AStar` agent is, for example:\n\n```json\n{\n  \"AStar\": null\n}\n```\n\n\u003e If a config parameter (like f.e. `health`) is excluded the default value is used.\n\n### Simulating Configs\n\nThis tool can be used to simulate different configurations.\nThese configurations specify the agent and its hyperparameters.\nIf no parameters are provided, the default values for the agent are used.\nThe number of simulated games can be specified with `--game-count`.\nUse `-h` for more information about other arguments to define the board size and game rules.\n\nThe example below simulates the `AStar` and `Random` agents for 10 games:\n\n```bash\ncargo run --release --bin simulate -- '{\"AStar\":{ }}' '{\"Random\":{ }}' --game-count 10\n```\n\nThe last line of the standard output contains the number of wins of the first snake and the total number of games played:\n\n```\nResult: 3/10\n```\n\n### Testing moves\n\nThe `move` program outputs the chosen move for a given game state and agent configuration.\nThis can be useful for debugging situational bugs.\nThe game input can be downloaded from the [battlesnake](https://play.battlesnake.com) with this [Firefox extension](https://addons.mozilla.org/firefox/addon/battlesnake-downloader/).\n\n```bash\ncargo run --release --bin move -- [--config \u003cjson\u003e] [--runtime] \u003cjson\u003e\n```\n\n### Running tests \u0026 benchmarks\n\nThere are multiple tests for the different modules that can be run, as shown below.\nFor more information on unit testing in Rust, see https://doc.rust-lang.org/book/ch11-01-writing-tests.html.\n\n```bash\ncargo test -- [--nocapture] [testname]\n```\n\nBesides the functional tests, there are several performance benchmarks.\nThey are executed with the release config with compiler and linker optimizations.\nThe criterion benchmark runner tracks the execution times from previous runs and reports any improvements or degradations.\n\n```bash\ncargo bench -- [testname]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwrenger%2Fhadar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwrenger%2Fhadar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwrenger%2Fhadar/lists"}