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
56d88011
Commit
56d88011
authored
May 10, 2018
by
Daniel Albert
Browse files
Options
Browse Files
Download
Plain Diff
Port typo correction to new description in default code
parents
0755e1ad
658f9947
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ide/templates/ide/initial-bot.lua
ide/templates/ide/initial-bot.lua
+3
-3
No files found.
ide/templates/ide/initial-bot.lua
View file @
56d88011
...
...
@@ -20,7 +20,7 @@ end
-- with 0, the snake keeps its current direction.
function
step
()
-- there is some info in the "self" object, e.g. your current head/segment radius
local
own_radius
=
self
.
r
local
own_radius
=
self
.
segment_radius
-- your snake needs food to grow
-- to find food in your head's surroundings, call something like that:
...
...
@@ -34,7 +34,7 @@ function step()
-- distance of the food item, relative to the center of your head
local
distance
=
item
.
dist
-- direction to the food item, in radians (
0..2*
math.pi)
-- direction to the food item, in radians (
-math.pi .. +
math.pi)
-- 0 means "straight ahead", math.pi means "right behind you"
local
direction
=
item
.
d
...
...
@@ -60,7 +60,7 @@ function step()
-- distance to the center of the segment
local
distance
=
item
.
dist
-- direction to the segment, in radians (
0..2*
math.pi)
-- direction to the segment, in radians (
-math.pi .. +
math.pi)
local
direction
=
item
.
d
-- radius of the segment
...
...
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