{"id":13692855,"url":"https://github.com/pambrose/battlesnake-examples","last_synced_at":"2026-02-16T03:31:25.084Z","repository":{"id":136503856,"uuid":"174734409","full_name":"pambrose/battlesnake-examples","owner":"pambrose","description":"Battlesnake Quickstart Snake Examples","archived":false,"fork":false,"pushed_at":"2022-02-10T01:15:07.000Z","size":287,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-12T18:42:16.885Z","etag":null,"topics":["battlesnake","battlesnakeio","java","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/pambrose.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":"2019-03-09T18:58:24.000Z","updated_at":"2021-12-31T22:51:22.000Z","dependencies_parsed_at":"2024-04-08T02:18:24.114Z","dependency_job_id":"8bafca6c-972e-4d41-a864-4fb0dd1c81d8","html_url":"https://github.com/pambrose/battlesnake-examples","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/pambrose%2Fbattlesnake-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pambrose%2Fbattlesnake-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pambrose%2Fbattlesnake-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pambrose%2Fbattlesnake-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pambrose","download_url":"https://codeload.github.com/pambrose/battlesnake-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095461,"owners_count":21693921,"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":["battlesnake","battlesnakeio","java","kotlin"],"created_at":"2024-08-02T17:01:02.704Z","updated_at":"2026-02-16T03:31:25.059Z","avatar_url":"https://github.com/pambrose.png","language":"Kotlin","funding_links":[],"categories":["Battlesnakes"],"sub_categories":[],"readme":"# Battlesnake Quickstart Snake Examples\n\n[![Build Status](https://travis-ci.org/pambrose/battlesnake-examples.svg?branch=master)](https://travis-ci.org/pambrose/battlesnake-examples)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/026f7e49beb9432fbdf0cf47b5e40eb3)](https://www.codacy.com/app/pambrose/battlesnake-examples?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=pambrose/battlesnake-examples\u0026amp;utm_campaign=Badge_Grade)\n\nA collection of simple [Battlesnakes](http://battlesnake.io) written in Kotlin and Java using \nthe [Battlesnake Quickstart](https://github.com/pambrose/battlesnake-quickstart) framework.\n\nVisit [Battlesnake.io](https://docs.battlesnake.io) for API documentation and instructions for creating a game.\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/pambrose/battlesnake-examples)\n[![Deploy on Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/pambrose/battlesnake-examples)\n[![Run on Repl.it](https://repl.it/badge/github/pambrose/battlesnake-examples)](https://repl.it/github/pambrose/battlesnake-examples)\n\n## Snake Definitions\n\nVisit [Battlesnake Quickstart](https://github.com/pambrose/battlesnake-quickstart) for a description\nof how to define kotlin and java snakes.\n\n## Snake Examples\n\n### Kotlin\n* [SimpleSnake](src/main/kotlin/io/battlesnake/examples/kotlin/SimpleSnake.kt)\n* [PerimeterSnakeWithLists](src/main/kotlin/io/battlesnake/examples/kotlin/PerimeterSnakeWithLists.kt)\n* [PerimeterSnakeWithSequences](src/main/kotlin/io/battlesnake/examples/kotlin/PerimeterSnakeWithSequences.kt)\n* [CenterSquareSnake](src/main/kotlin/io/battlesnake/examples/kotlin/CenterSquareSnake.kt)\n* [StripedSnake](src/main/kotlin/io/battlesnake/examples/kotlin/StripedSnake.kt)\n\n### Java\n* [SimpleSnake](src/main/java/io/battlesnake/examples/java/SimpleSnake.java)\n* [PerimeterSnake](src/main/java/io/battlesnake/examples/java/PerimeterSnake.java)\n\n## Clone your own snake\n\nUse the [Battlesnake Template](https://github.com/pambrose/battlesnake-template) to clone the code for your own snake.\n\n## Snake Execution\n\nA server can support running multiple snakes, but they must be the same snake object type.\n\nAssign the `mainName` variable in [build.gradle](./build.gradle#L36) to the desired fully qualified \nsnake classname. For example:\n```groovy\ndef mainName = 'io.battlesnake.examples.kotlin.PerimeterSnakeWithLists'\n```\n\nYou can run a snake with a script or as an uberjar:\n\n* Build and run the script **build/install/battlesnake-examples/bin/snake** with: `make script`.\n\n* Build and run the uberjar **build/libs/snake.jar** with: `make uber`.\n\n## Deployment Options\n\n### localhost\n\nUse [localtunnel](https://theboroer.github.io/localtunnel-www/) to make a locally running snake visible to the\nBattlesnake server.\n\n1) Run localtunnel with: `lt --port 8080`\n\n2) Use the URL returned as your snake URL.\n\n3) Follow the [Snake Execution](#snake-execution) instructions to run a snake.\n\nYou can also use [ngrok](https://ngrok.com), but unpaid users may experience \"429 Too Many Requests\" errors, which will\ncause your snake to move UP.\n\n1) Run ngrok with: `ngrok http 8080`\n\n2) Use either of the `Forwarding` URLs displayed in the ngrok console as your snake URL.\n\n3) Follow the [Snake Execution](#snake-execution) instructions to run a snake.\n\n### [Gitpod](https://gitpod.io)\n\n1) Click on the [Open in Gitpod](https://gitpod.io/#https://github.com/pambrose/battlesnake-examples)\nbadge above.\n \n2) Follow the [Snake Execution](#snake-execution) instructions to run a snake. \n\n3) After starting the snake, click on **Open Preview** on the pop-up window.\n\n4) Use the URL displayed in the Gitpod browser window as your snake URL. You can\nalso visit the **/info** endpoint for more information.\n\n### [repl.it](https://repl.it)\n\n1) Click on the [run on repl.it](https://repl.it/github/pambrose/battlesnake-examples)\nbadge above.\n \n2) Follow the [Snake Execution](#snake-execution) instructions to run a snake. \n\n3) Use the URL displayed in the repl.it browser window as your snake URL.\nYou can also visit the **/info** endpoint for more information.\n\n### [Heroku](https://www.heroku.com)\n\n1) Create a new Heroku app with: `heroku create [APP_NAME]`\n\n2) Deploy code to Heroku with: `git push heroku master`\n\n3) Open the Heroku app in a browser with: `heroku open` \nor visit [http://APP_NAME.herokuapp.com](http://APP_NAME.herokuapp.com).\n\n4) Use the Heroku URL address as your snake URL. You can\nalso visit the **/info** endpoint for more information.\n\n5) View the server logs with: `heroku logs --tail`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpambrose%2Fbattlesnake-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpambrose%2Fbattlesnake-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpambrose%2Fbattlesnake-examples/lists"}