{"id":13693030,"url":"https://github.com/tyrelh/battlesnake2018","last_synced_at":"2025-05-02T21:31:07.482Z","repository":{"id":99593100,"uuid":"122387790","full_name":"tyrelh/battlesnake2018","owner":"tyrelh","description":"BattleSnake AI server written in Python. ","archived":false,"fork":false,"pushed_at":"2019-01-21T07:17:57.000Z","size":632,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-03T17:14:49.263Z","etag":null,"topics":["ai","battlesnake","game","hackathon","programming-contests","python","snake"],"latest_commit_sha":null,"homepage":"https://battlesnake.io","language":"Python","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/tyrelh.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}},"created_at":"2018-02-21T20:11:12.000Z","updated_at":"2020-09-06T17:48:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"f472fa43-2d60-47ce-ada5-f3934ad65219","html_url":"https://github.com/tyrelh/battlesnake2018","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/tyrelh%2Fbattlesnake2018","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrelh%2Fbattlesnake2018/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrelh%2Fbattlesnake2018/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyrelh%2Fbattlesnake2018/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyrelh","download_url":"https://codeload.github.com/tyrelh/battlesnake2018/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224337254,"owners_count":17294690,"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":["ai","battlesnake","game","hackathon","programming-contests","python","snake"],"created_at":"2024-08-02T17:01:04.731Z","updated_at":"2024-11-12T19:30:19.244Z","avatar_url":"https://github.com/tyrelh.png","language":"Python","funding_links":[],"categories":["Battlesnakes"],"sub_categories":[],"readme":"# BattleSnake 2018\n\nThis is a Snake entry for the [BattleSnake](http://battlesnake.io) programming competition in Victoria BC, written in Python.\n\nForked from the [Python starter snake](https://github.com/sendwithus/battlesnake-python) provided by [sendwithus](https://www.sendwithus.com).\n\nThis AI client uses the [bottle web framework](http://bottlepy.org/docs/dev/index.html) to serve requests and the [gunicorn web server](http://gunicorn.org/) for running bottle on [Heroku](https://heroku.com). Dependencies are listed in [requirements.txt](requirements.txt).\n\n## State of AI\n\n2018/02/19 - Now will track smaller snakes heads and try to move into their next location to kill them, only when it is the largest snake on the board, otherwise it will seek food to grow longer.\n\n2018/02/17 - Will get an optimal direction from a* for the given target, and then look ahead at that move and the other possible moves to evaluate which is best. It also now tracks the length of other snakes and will eat to try to be largest. Now will properly prioritize head neighbor locations of snakes that are smaller than it when it is near so it can try to eat them. Working on agressive hunting behaviour when it is the largest snake.\n\n2018/02/13 - Switches between following own tail to kill time if health is above threshold and seeking nearest food if health is below threshold.\n\n2018/02/13 - Will seek closest food. Generally will avoid snake bodies and outer wall on each move.\n\n2018/02/10 - Currently runs in a circle. No pathfinding or avoidance behaviour.\n\n## Running the Snake Locally\n\n1) [Fork this repo](https://github.com/tyrelh/battlesnake-python/fork).\n\n2) Clone repo to your development environment:\n```\ngit clone git@github.com:username/battlesnake-python.git\n```\n\n3) Install dependencies using [pip](https://pip.pypa.io/en/latest/installing.html):\n```\npip install -r requirements.txt\n```\n\n4) Run local server:\n```\npython app/main.py\n```\n\n5) Test client in your browser: [http://localhost:8080](http://localhost:8080).\n\n## Deploying to Heroku\n\n1) Create a new Heroku app:\n```\nheroku create [APP_NAME]\n```\n\n2) Deploy code to Heroku servers:\n```\ngit push heroku master\n```\n\n3) Open Heroku app in browser:\n```\nheroku open\n```\nor visit [http://APP_NAME.herokuapp.com](http://APP_NAME.herokuapp.com).\n\n4) View server logs with the `heroku logs` command:\n```\nheroku logs --tail\n```\n\n## Questions?\n\nContact me [tyrel.hiebert@gmail.com](mailto:tyrel.hiebert@gmail.com) or contact [sendwithus](https://www.sendwithus.com) [battlesnake@sendwithus.com](mailto:battlesnake@sendwithus.com), [@send_with_us](http://twitter.com/send_with_us).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyrelh%2Fbattlesnake2018","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyrelh%2Fbattlesnake2018","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyrelh%2Fbattlesnake2018/lists"}