Skip to content

Commit

Permalink
Fix some inaccuracies in the docs
Browse files Browse the repository at this point in the history
was missing mention of dead_snakes in /move.

Some examples were out of date.
  • Loading branch information
Dylan Kendal committed Mar 4, 2017
1 parent faaf28b commit 8970ae2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 27 deletions.
29 changes: 19 additions & 10 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,14 @@ <h4 id="sec-2-1-4"><span class="section-number-4">2.1.4</span> Example Response<
<div class="org-src-container">

<pre class="src src-js"><span class="org-rainbow-delimiters-depth-1">{</span>
<span class="org-string">"color"</span>: <span class="org-string">"#FF0000"</span>,
<span class="org-string">"head_url"</span>: <span class="org-string">"http://placecage.com/c/100/100"</span>,
<span class="org-string">"name"</span>: <span class="org-string">"Cage Snake"</span>,
<span class="org-string">"taunt"</span>: <span class="org-string">"OH GOD NOT THE BEES"</span>
<span class="org-rainbow-delimiters-depth-1">}</span>
<span class="org-string">"color"</span>: <span class="org-string">"#FF0000"</span>,
<span class="org-string">"secondary_color"</span>: <span class="org-string">"#00FF00"</span>,
<span class="org-string">"head_url"</span>: <span class="org-string">"http://placecage.com/c/100/100"</span>,
<span class="org-string">"name"</span>: <span class="org-string">"Cage Snake"</span>,
<span class="org-string">"taunt"</span>: <span class="org-string">"OH GOD NOT THE BEES"</span>
<span class="org-string">"head_type"</span>: <span class="org-string">"pixel"</span>,
<span class="org-string">"tail_type"</span>: <span class="org-string">"pixel"</span>
<span class="org-rainbow-delimiters-depth-1">}</span>
</pre>
</div>
</div>
Expand Down Expand Up @@ -541,6 +544,12 @@ <h4 id="sec-2-2-1"><span class="section-number-4">2.2.1</span> Request Attribute
<td class="text-left">Array of all living snakes in the game</td>
</tr>

<tr>
<td class="text-left"><b>dead_snake</b></td>
<td class="text-left">Array&lt;<a href="#type-snake">Snake</a>&gt;</td>
<td class="text-left">Array of all dead snakes in the game</td>
</tr>

<tr>
<td class="text-left"><b>turn</b></td>
<td class="text-left">integer</td>
Expand Down Expand Up @@ -569,14 +578,14 @@ <h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> Example Request</
<div class="org-src-container">

<pre class="src src-js"><span class="org-rainbow-delimiters-depth-1">{</span>
<span class="org-string">"you"</span>: <span class="org-string">"25229082-f0d7-4315-8c52-6b0ff23fb1fb"</span>,
<span class="org-string">"you"</span>: <span class="org-string">"2c4d4d70-8cca-48e0-ac9d-03ecafca0c98"</span>,
<span class="org-string">"width"</span>: <span class="org-highlight-numbers-number">2</span>,
<span class="org-string">"turn"</span>: <span class="org-highlight-numbers-number">0</span>,
<span class="org-string">"snakes"</span>: <span class="org-rainbow-delimiters-depth-2">[</span>
<span class="org-rainbow-delimiters-depth-3">{</span>
<span class="org-string">"taunt"</span>: <span class="org-string">"git gud"</span>,
<span class="org-string">"name"</span>: <span class="org-string">"my-snake"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"25229082-f0d7-4315-8c52-6b0ff23fb1fb"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"2c4d4d70-8cca-48e0-ac9d-03ecafca0c98"</span>,
<span class="org-string">"health_points"</span>: <span class="org-highlight-numbers-number">93</span>,
<span class="org-string">"coords"</span>: <span class="org-rainbow-delimiters-depth-4">[</span>
<span class="org-rainbow-delimiters-depth-5">[</span>
Expand All @@ -596,7 +605,7 @@ <h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> Example Request</
<span class="org-rainbow-delimiters-depth-3">{</span>
<span class="org-string">"taunt"</span>: <span class="org-string">"gotta go fast"</span>,
<span class="org-string">"name"</span>: <span class="org-string">"other-snake"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"0fd33b05-37dd-419e-b44f-af9936a0a00c"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"c35dcf26-7f48-492c-b7b5-94ae78fbc713"</span>,
<span class="org-string">"health_points"</span>: <span class="org-highlight-numbers-number">50</span>,
<span class="org-string">"coords"</span>: <span class="org-rainbow-delimiters-depth-4">[</span>
<span class="org-rainbow-delimiters-depth-5">[</span>
Expand All @@ -615,7 +624,7 @@ <h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> Example Request</
<span class="org-rainbow-delimiters-depth-3">}</span>
<span class="org-rainbow-delimiters-depth-2">]</span>,
<span class="org-string">"height"</span>: <span class="org-highlight-numbers-number">2</span>,
<span class="org-string">"game_id"</span>: <span class="org-string">"870d6d79-93bf-4941-8d9e-944bee131167"</span>,
<span class="org-string">"game_id"</span>: <span class="org-string">"a2facef2-b031-44ba-a36c-0859c389ef96"</span>,
<span class="org-string">"food"</span>: <span class="org-rainbow-delimiters-depth-2">[</span>
<span class="org-rainbow-delimiters-depth-3">[</span>
<span class="org-highlight-numbers-number">1</span>,
Expand All @@ -626,7 +635,7 @@ <h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> Example Request</
<span class="org-rainbow-delimiters-depth-3">{</span>
<span class="org-string">"taunt"</span>: <span class="org-string">"gotta go fast"</span>,
<span class="org-string">"name"</span>: <span class="org-string">"other-snake"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"c4e48602-197e-40b2-80af-8f89ba005ee9"</span>,
<span class="org-string">"id"</span>: <span class="org-string">"83fdf2b9-c8d0-44f4-acb2-0c506139079e"</span>,
<span class="org-string">"health_points"</span>: <span class="org-highlight-numbers-number">50</span>,
<span class="org-string">"coords"</span>: <span class="org-rainbow-delimiters-depth-4">[</span>
<span class="org-rainbow-delimiters-depth-5">[</span>
Expand Down
44 changes: 27 additions & 17 deletions docs/index.org
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ All responses are expected to have a =200 OK= status code.
- Code: =200 OK=
- Content:
#+BEGIN_SRC js
{
{
"color": "#FF0000",
"secondary_color": "#00FF00",
"head_url": "http://placecage.com/c/100/100",
"name": "Cage Snake",
"taunt": "OH GOD NOT THE BEES"
"head_type": "pixel",
"tail_type": "pixel"
}
#+END_SRC
*** Sample call
Expand Down Expand Up @@ -156,17 +159,18 @@ All responses are expected to have a =200 OK= status code.
| *Headers* | Content-Type: application-json |

*** Request Attributes
| Attribute | Type | |
|-----------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <l> | <l> | |
| *food* | Array<[[#type-point][Point]]> | Array of all food currently on the board |
| *game_id* | UUID | |
| *height* | integer | |
| *snakes* | Array<[[#type-snake][Snake]]> | Array of all living snakes in the game |
| *turn* | integer | The current turn. |
| *width* | integer | |
| *you* | UUID | A reference to your snake's id, the snake object can be found in =snakes=. |
|-----------+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Attribute | Type | |
|--------------+--------------+----------------------------------------------------------------------------|
| <l> | <l> | |
| *food* | Array<[[#type-point][Point]]> | Array of all food currently on the board |
| *game_id* | UUID | |
| *height* | integer | |
| *snakes* | Array<[[#type-snake][Snake]]> | Array of all living snakes in the game |
| *dead_snake* | Array<[[#type-snake][Snake]]> | Array of all dead snakes in the game |
| *turn* | integer | The current turn. |
| *width* | integer | |
| *you* | UUID | A reference to your snake's id, the snake object can be found in =snakes=. |
|--------------+--------------+----------------------------------------------------------------------------|

*** Example Request
#+BEGIN_SRC elixir :remsh org-server@localhost :sname org-console :wrap "SRC js" :eval no-export :exports results :results value
Expand Down Expand Up @@ -202,6 +206,12 @@ All responses are expected to have a =200 OK= status code.
name: "other-snake",
taunt: "gotta go fast",
url: "localhost:4001",
cause_of_death: %BattleSnake.Death{
turn: 0,
causes: [
%BattleSnake.Death.StarvationCause{}
]
}
}

food = [p(1,1)]
Expand All @@ -223,14 +233,14 @@ All responses are expected to have a =200 OK= status code.
#+RESULTS[e909af054857d10965dd9905fdf8433dcd44ba75]:
#+BEGIN_SRC js
{
"you": "25229082-f0d7-4315-8c52-6b0ff23fb1fb",
"you": "2c4d4d70-8cca-48e0-ac9d-03ecafca0c98",
"width": 2,
"turn": 0,
"snakes": [
{
"taunt": "git gud",
"name": "my-snake",
"id": "25229082-f0d7-4315-8c52-6b0ff23fb1fb",
"id": "2c4d4d70-8cca-48e0-ac9d-03ecafca0c98",
"health_points": 93,
"coords": [
[
Expand All @@ -250,7 +260,7 @@ All responses are expected to have a =200 OK= status code.
{
"taunt": "gotta go fast",
"name": "other-snake",
"id": "0fd33b05-37dd-419e-b44f-af9936a0a00c",
"id": "c35dcf26-7f48-492c-b7b5-94ae78fbc713",
"health_points": 50,
"coords": [
[
Expand All @@ -269,7 +279,7 @@ All responses are expected to have a =200 OK= status code.
}
],
"height": 2,
"game_id": "870d6d79-93bf-4941-8d9e-944bee131167",
"game_id": "a2facef2-b031-44ba-a36c-0859c389ef96",
"food": [
[
1,
Expand All @@ -280,7 +290,7 @@ All responses are expected to have a =200 OK= status code.
{
"taunt": "gotta go fast",
"name": "other-snake",
"id": "c4e48602-197e-40b2-80af-8f89ba005ee9",
"id": "83fdf2b9-c8d0-44f4-acb2-0c506139079e",
"health_points": 50,
"coords": [
[
Expand Down

0 comments on commit 8970ae2

Please sign in to comment.