exNoops v0.1.2 Exnoops.Pathbot View Source
Module to interact with Github's Noop: Pathbot
See the official `noop` documentation for API information including the accepted parameters.
Link to this section Summary
Link to this section Functions
Link to this function
start() View Source
Start helping `pathbot` out of the maze!
Examples
iex> Exnoops.Pathbot.start()
{:ok, %{
"status" => "in-progress",
"message" => "You find yourself in a strange room. You're not sure how you got here but you know you need to escape, somehow.",
"exits" => [ "N", "S" ],
"description" => "You are in a bright long dining room with exits to the North and South. You sense that the maze's exit is to the North, at least 6 rooms away..",
"mazeExitDirection" => "N",
"mazeExitDistance" => 6,
"locationPath" => "/pathbot/rooms/LU62ZaD_SqudPvH3Qt3kJQ"
}}
Link to this function
submit_direction(path, direction) View Source
Submit directions to pathbot
Examples
iex> Exnoops.Pathbot.submit_direction("/pathbot/rooms/LU62ZaD_SqudPvH3Qt3kJQ", "N")
{:ok, %{
"status" => "in-progress",
"message" => "You are trapped in a maze",
"exits" => [ "N", "S" ],
"description" => "You are in a chartreuse rectangular storage room with exits to the North and South. You sense that the maze's exit is to the North, at least 5 rooms away..",
"mazeExitDirection" => "N",
"mazeExitDistance" => 5,
"locationPath" => "/pathbot/rooms/OkNMk8D_XfLtYgnicZWzcA"
}}
iex> Exnoops.Pathbot.submit_direction("/pathbot/rooms/RPq3xhL51USGI_iU16alKA", "N")
{:ok, %{
"status" => "finished",
"description" => "Congratulations! You have escaped the maze."
}}