starter-snake-haskell-1.0.0: A Haskell Battlesnake starter
Safe HaskellSafe-Inferred
LanguageHaskell2010

Battlesnake.Server

Synopsis

Documentation

type GameRequestHandler a = GameRequest -> IO a Source #

A handler for a battlesnake server request.

runBattlesnakeServer :: InfoResponse -> GameRequestHandler () -> GameRequestHandler MoveResponse -> GameRequestHandler () -> IO () Source #

Run a battlesnake server. Runs the server on the port specified by the environment variable PORT or port 3000 if the variable is not set. * A Battlesnake.API.InfoResponse to be returned when the server receives an info request. * A GameRequestHandler to be called when the server receives a start request. * A GameRequestHandler to be called when the server receives a move request. * A GameRequestHandler to be called when the server receives an end request.