Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Jochen Bauer
spn-website
Commits
5f278572
Commit
5f278572
authored
May 09, 2018
by
nachtgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs improved
parent
4d0da7c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
docs/lua/sample.lua
docs/lua/sample.lua
+11
-4
docs/templates/docs/docs.html
docs/templates/docs/docs.html
+11
-4
No files found.
docs/lua/sample.lua
View file @
5f278572
--- This is a brief overview of all usable functions within the bot logic.
--- Every bot is allowed to store 100MB within the global namespace and the
--- data persists until the bot dies. So the bot can save data from frame
--- to frame.
--- Every player can start with a simple demo bot. You get the code in the
--- <a href="/snake/edit/latest">editor</a>. A snake hungers, so it constantly
--- loses size. Feed it and it will stay alive and grows. Your snake will die,
--- when it touches another snake with its head.
---
--- <h2>Lua global namespace</h2>
--- <p>Every snake is allowed to store 100MB within the global namespace and the
--- data persists until the bot dies. So the bot can save data from frame
--- to frame.</p>
--- <p>The following Lua standard functions are allowed:</p>
--- <table>
--- <tr><td><a href="https://www.lua.org/manual/5.3/manual.html#pdf-assert">assert</a></td>
...
...
@@ -86,7 +91,9 @@ function init()
end
--- That function returns all food as list.
-- The list is ordered by food value, from largest to lowest.
-- The list is ordered by food value, from largest to lowest. The values of new spawning
-- food are calculated based on a mean value of 3.5 and a standard deviation of 2.
-- A killed snake drops a part of the consumed food, that is distributed by the same rule.
-- @param max_distance all food within the distance is included
-- @param minimum_food_value all lower food values are filtered (min: 0, max: unknown)
-- @usage local food = findFood(max_distance, 0.8)
...
...
docs/templates/docs/docs.html
View file @
5f278572
...
...
@@ -26,10 +26,15 @@
<p>
This is a brief overview of all usable functions within the bot logic.
</p>
<p>
Every bot is allowed to store 100MB within the global namespace and the
data persists until the bot dies. So the bot can save data from frame
to frame.
Every player can start with a simple demo bot. You get the code in the
<a
href=
"/snake/edit/latest"
>
editor
</a>
. A snake hungers, so it constantly
loses size. Feed it and it will stay alive and grows. Your snake will die,
when it touches another snake with its head.
<h2>
Lua global namespace
</h2>
<p>
Every snake is allowed to store 100MB within the global namespace and the
data persists until the bot dies. So the bot can save data from frame
to frame.
</p>
<p>
The following Lua standard functions are allowed:
</p>
<table>
<tr><td><a
href=
"https://www.lua.org/manual/5.3/manual.html#pdf-assert"
>
assert
</a></td>
...
...
@@ -173,7 +178,9 @@
</dt>
<dd>
That function returns all food as list.
The list is ordered by food value, from largest to lowest.
The list is ordered by food value, from largest to lowest. The values of new spawning
food are calculated based on a mean value of 3.5 and a standard deviation of 2.
A killed snake drops a part of the consumed food, that is distributed by the same rule.
<h4>
Parameters:
</h4>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment