Kotlin Battlesnake Starter Snak

by athenian-programming

GitHub Readme.md

starter-snake-kotlin

Build Status

A simple Battlesnake written in Kotlin.

Visit https://docs.battlesnake.io for API documentation and instructions for creating a game.

This snake is built using a lightweight http server Spark framework - http://sparkjava.com/documentation

Deploy

Requirements

Running the snake

Assign the mainName variable in build.gradle to the proper Snake classname.

Use ngrok to make a locally running snake visible to the BattleSnake server.

./gradlew run

The snake will start up on port 8080.

Run the tests

./gradlew test

Executable UberJar

Build the uberjar build/libs/starter-snake-kotlin.jar with:

./gradlew stage

Run the uberjar with:

java -jar build/libs/starter-snake-kotlin.jar

Deploying to Heroku

  1. Create a new Heroku app with:
heroku create [APP_NAME]
  1. Deploy code to Heroku with:
git push heroku master
  1. Open Heroku app in browser with:
heroku open

or visit http://APP_NAME.herokuapp.com.

  1. View server logs with the heroku logs command with:
heroku logs --tail