{"id":15626596,"url":"https://github.com/chaelcodes/hettiecodes","last_synced_at":"2026-02-02T08:38:42.872Z","repository":{"id":40524834,"uuid":"406534329","full_name":"ChaelCodes/HettieCodes","owner":"ChaelCodes","description":"An albino hognose battlesnake built using Ruby. Their arch-nemesis CorneliusCodes always takes valedictorian.","archived":false,"fork":false,"pushed_at":"2023-03-17T02:44:03.000Z","size":19,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T22:05:33.363Z","etag":null,"topics":["battlesnake"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ChaelCodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-09-14T22:06:07.000Z","updated_at":"2022-01-20T02:52:09.000Z","dependencies_parsed_at":"2024-04-08T11:03:44.526Z","dependency_job_id":null,"html_url":"https://github.com/ChaelCodes/HettieCodes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"BattlesnakeOfficial/starter-snake-ruby","purl":"pkg:github/ChaelCodes/HettieCodes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChaelCodes%2FHettieCodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChaelCodes%2FHettieCodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChaelCodes%2FHettieCodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChaelCodes%2FHettieCodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChaelCodes","download_url":"https://codeload.github.com/ChaelCodes/HettieCodes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChaelCodes%2FHettieCodes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29008264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T08:20:25.892Z","status":"ssl_error","status_checked_at":"2026-02-02T08:20:04.345Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["battlesnake"],"created_at":"2024-10-03T10:13:04.805Z","updated_at":"2026-02-02T08:38:42.856Z","avatar_url":"https://github.com/ChaelCodes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# A simple [Battlesnake](http://play.battlesnake.com) written in Ruby.\n\nThis is a basic implementation of the [Battlesnake API](https://docs.battlesnake.com/snake-api). It's a great starting point for anyone wanting to program their first Battlesnake using Ruby. It comes ready to deploy to [Heroku](https://heroku.com), although you can use other cloud providers if you'd like.\n\n### Maintanance\n\nThis is a community maintained Starter Project Battlesnake!\n\nContribute to Open Source, and help keep this project up-to-date via pull request. Pull requests will be reviewed and merged by the [Battlesnake Official](https://github.com/BattlesnakeOfficial) team.\n\nGet involved in the Battlesnake community!\n* [Discord](https://play.battlesnake.com/discord)\n* [Twitch](https://www.twitch.tv/battlesnakeofficial)\n\n### Technologies\n\nThis Battlesnake uses [Ruby 2.7](https://www.ruby-lang.org/), and [Heroku](https://heroku.com).\n\n### Prerequisites\n\n* [GitHub Account](https://github.com/) and [Git Command Line](https://www.atlassian.com/git/tutorials/install-git)\n* [Heroku Account](https://signup.heroku.com/) and [Heroku Command Line](https://devcenter.heroku.com/categories/command-line)\n* [Battlesnake Account](https://play.battlesnake.com)\n\n\n\n## Deploying Your First Battlesnake\n\n1. [Fork this repo](https://github.com/BattlesnakeOfficial/starter-snake-ruby/fork) into your GitHub Account.\n\n2. [Clone your forked repo](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) into your local environment.\n    ```shell\n    git clone git@github.com:[YOUR-GITHUB-USERNAME]/starter-snake-ruby.git\n    ```\n\n3. [Create a new Heroku app](https://devcenter.heroku.com/articles/creating-apps) to run your Battlesnake.\n    ```shell\n    heroku create [YOUR-APP-NAME]\n    ```\n\n4. [Deploy your Battlesnake code to Heroku](https://devcenter.heroku.com/articles/git#deploying-code).\n    ```shell\n    git push heroku master\n    ```\n\n5. Open your new Heroku app in your browser.\n    ```shell\n    heroku open\n    ```\n    If everything was successful, you should see the following text:\n    ```\n    {\"apiversion\":\"1\",\"author\":\"\",\"color\":\"#888888\",\"head\":\"default\",\"tail\":\"default\"}\n    ```\n\n6. Optionally, you can view your server logs using the [Heroku logs command](https://devcenter.heroku.com/articles/logging#log-retrieval) `heroku logs --tail`. The `--tail` option will show a live feed of your logs in real-time.\n\n**At this point your Battlesnake is live and ready to enter games!**\n\n\n\n## Registering Your Battlesnake and Creating Your First Game\n\n1. Log in to [play.battlesnake.com](https://play.battlesnake.com/login/).\n\n2. [Create a new Battlesnake](https://play.battlesnake.com/account/snakes/create/). Give it a name and complete the form using the URL for your Heroku app.\n\n3. Once your Battlesnake has been saved you can [create a new game](https://play.battlesnake.com/account/games/create/) and add your Battlesnake to it. Type your Battlesnake's name into the search field and click \"Add\" to add it to the game. Then click \"Create Game\" to start the game.\n\n4. You should see a brand new Battlesnake game with your Battlesnake in it! Yay! Press \"Play\" to start the game and watch how your Battlesnake behaves. By default your Battlesnake should move randomly around the board.\n\n5. Optionally, open your [Heroku logs](https://devcenter.heroku.com/articles/logging#log-retrieval) while the game is running to see your Battlesnake receiving API calls and responding with its moves.\n\nRepeat steps 3 and 4 every time you want to see how your Battlesnake behaves. It's common for Battlesnake developers to repeat these steps often as they make their Battlesnake smarter.\n\n**At this point you should have a registered Battlesnake and be able to create games!**\n\n\n\n## Customizing Your Battlesnake\n\nNow you're ready to start customizing your Battlesnake and improving its algorithm.\n\n### Changing Appearance\n\nLocate the `/` endpoint inside [app/app.rb](app/app.rb#L11). You should see code that looks like this:\n```ruby\n appearance = {\n    apiversion: \"1\",        \n    author: \"\",           # TODO: Your Battlesnake Username\n    color: \"#888888\",     # TODO: Personalize\n    head: \"default\",      # TODO: Personalize\n    tail: \"default\",      # TODO: Personalize\n  }\n```\n\nThis function is called by the game engine periodically to make sure your Battlesnake is healthy, responding correctly, and to determine how your Battlesnake will appear on the game board. See [Battlesnake Personalization](https://docs.battlesnake.com/references/personalization) for how to customize your Battlesnake's appearance using these values.\n\nWhenever you update these values, you can refresh your Battlesnake on [your profile page](https://play.battlesnake.com/me/) to use your latest configuration. Your changes should be reflected in the UI, as well as any new games created.\n\n### Changing Behavior\n\nOn every turn of each game your Battlesnake receives information about the game board and must decide its next move.\n\nLocate the `move` function inside [app/move.rb](app/move.rb#L4). You should see code that looks like this:\n```ruby\ndef move(board)\n  # Choose a random direction to move in\n  possible_moves = [\"up\", \"down\", \"left\", \"right\"]\n  move = possible_moves.sample\n  puts \"MOVE: \" + move\n  { \"move\": move }\nend\n```\n\nPossible moves are \"up\", \"down\", \"left\", or \"right\". To start your Battlesnake will choose a move randomly. Your goal as a developer is to read information sent to you about the board (available in the `board` variable) and make an intelligent decision about where your Battlesnake should move next. \n\nSee the [Battlesnake Rules](https://docs.battlesnake.com/rules) for more information on playing the game, moving around the board, and improving your algorithm.\n\n### Updating Your Battlesnake\n\nAfter making changes, commit them using git and deploy your changes to Heroku.\n```shell\ngit add .\ngit commit -m \"update my battlesnake's appearance\"\ngit push heroku master\n```\n\nOnce Heroku has updated you can [create a new game](https://play.battlesnake.com/account/games/create/) with your Battlesnake to view your latest changes in action.\n\n**At this point you should feel comfortable making changes to your code and deploying those changes to Heroku!**\n\n\n\n## Developing Your Battlesnake Further\n\nNow you have everything you need to start making your Battlesnake super smart! Here are a few more helpful tips:\n\n* Keeping your logs open in a second window (using `heroku logs --tail`) is helpful for watching server activity and debugging any problems with your Battlesnake.\n\n* You can use the Ruby [puts function](http://ruby-doc.com/docs/ProgrammingRuby/html/ref_c_io.html#IO.puts) to output information to your server logs. This is very useful for debugging logic in your code during Battlesnake games.\n\n* Review the [Battlesnake API Docs](https://docs.battlesnake.com/snake-api) to learn what information is provided with each command. You can also output the data to your logs:\n```ruby\ndef move(board)\n  puts board\n  ...\n```\n\n* When viewing a Battlesnake game you can pause playback and step forward/backward one frame at a time. If you review your logs at the same time, you can see what decision your Battlesnake made on each turn.\n\n\n## Joining a Battlesnake Arena\n\nOnce you've made your Battlesnake behave and survive on its own, you can enter it into the [Global Battlesnake Arena](https://play.battlesnake.com/arena/global) to see how it performs against other Battlesnakes worldwide.\n\nArenas will regularly create new games and rank Battlesnakes based on their results. They're a good way to get regular feedback on how well your Battlesnake is performing, and a fun way to track your progress as you develop your algorithm.\n\n\n\n## (Optional) Running Your Battlesnake Locally\n\nEventually you might want to run your Battlesnake server locally for faster testing and debugging. You can do this by installing [Ruby 2.7](https://www.ruby-lang.org/en/) then install dependecies using [bundler](https://bundler.io/#getting-started):\n\n```shell\nbundle install\n```\n\nThen you can run the server:\n\n```shell\nruby app/app.rb\n```\n\nThis will start the Battlesnake server on port 4567.\n\n**Note:** You cannot create games on [play.battlesnake.com](https://play.battlesnake.com) using a locally running Battlesnake unless you install and use a port forwarding tool like [ngrok](https://ngrok.com/).\n\n\n---\n\n\n### Questions?\n\nAll documentation is available at [docs.battlesnake.com](https://docs.battlesnake.com), including detailed Guides, API References, and Tips.\n\nYou can also join the Battlesnake Developer Community on [Discord](https://play.battlesnake.com/discord). We have a growing community of Battlesnake developers of all skill levels wanting to help everyone succeed and have fun with Battlesnake :)\n\n### Feedback\n\n* **Do you have an issue or suggestions for this repository?** Head over to our [Feedback Repository](https://play.battlesnake.com/feedback) today and let us know!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaelcodes%2Fhettiecodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaelcodes%2Fhettiecodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaelcodes%2Fhettiecodes/lists"}