{"id":17038251,"url":"https://github.com/xffxff/snake-gym","last_synced_at":"2026-05-08T14:02:09.760Z","repository":{"id":126731646,"uuid":"164966104","full_name":"xffxff/snake-gym","owner":"xffxff","description":"Snake game as a gym environment","archived":false,"fork":false,"pushed_at":"2019-02-10T08:33:42.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T23:27:55.667Z","etag":null,"topics":["gym","multiplayer","snake","snake-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xffxff.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,"publiccode":null,"codemeta":null}},"created_at":"2019-01-10T01:22:14.000Z","updated_at":"2020-12-09T11:38:13.000Z","dependencies_parsed_at":"2023-06-17T20:30:47.942Z","dependency_job_id":null,"html_url":"https://github.com/xffxff/snake-gym","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xffxff/snake-gym","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xffxff%2Fsnake-gym","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xffxff%2Fsnake-gym/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xffxff%2Fsnake-gym/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xffxff%2Fsnake-gym/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xffxff","download_url":"https://codeload.github.com/xffxff/snake-gym/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xffxff%2Fsnake-gym/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001781,"owners_count":26083173,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["gym","multiplayer","snake","snake-game"],"created_at":"2024-10-14T08:56:21.647Z","updated_at":"2025-10-09T16:49:00.919Z","avatar_url":"https://github.com/xffxff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snake game as a Gym environment\n## Installation\n```\ngit clone https://github.com/XFFXFF/snake-gym  \ncd snake-gym  \npip install -e .\n```\n\n## How to use it\n### Running the classic snake game with random policy\n```python\nimport gym\nimport snake_gym\n\nenv = gym.make('Snake-rgb-v0')\nobs = env.reset()\nwhile True:\n    act = env.action_space.sample()\n    obs, rew, done, info = env.step(act)\n    env.render()\n    if done:\n        env.reset()\n```\n\n### Running multiple snakes with random policy.\n```python\nimport gym\nimport snake_gym\n\nenv = gym.make('MultiSnake-v0')\nenv.set_snakes(2) #set the number of snakes\nenv.set_foods(3) #set the number of random foods\nobs = env.reset()\nwhile True:\n    act = env.action_space.sample() \n    obs, rew, done, info = env.step(act)\n    env.render()\n    if info.get('game_over'):\n        env.reset()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxffxff%2Fsnake-gym","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxffxff%2Fsnake-gym","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxffxff%2Fsnake-gym/lists"}