Skip to content

Commit 09175a2

Browse files
committed
Added commands MarkCell and DrawLine to Protocol PDF, minor fixes in Markdown version
1 parent 1951447 commit 09175a2

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

Scalatron/doc/markdown/Scalatron Protocol.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ a mini-bot was spawned with `Spawn(...,role=missile)`, the `React` invocation wi
311311
parameter called `role` with the value `missile`.
312312

313313
The control function is expected to return a valid response, which may consist of zero or more
314-
commands separated by a pipe ('|') character. The available commands are listed in the section
314+
commands separated by a pipe (`|`) character. The available commands are listed in the section
315315
*Opcodes of Plugin-to-Server Commands*.
316316

317317

@@ -333,20 +333,28 @@ Parameters:
333333
# Opcodes of Plugin-to-Server Commands
334334

335335
These are the opcodes valid for commands returned by a plug-in to a server. Multiple such
336-
commands can be combined into a multi-command by separating them with a pipe ('|') character.
336+
commands can be combined into a multi-command by separating them with a pipe (`|`) character.
337+
338+
339+
340+
## Simulation-Affecting Commands
341+
342+
These commands, when executed by the server, alter the state of the game and affect the
343+
course of the simulation.
344+
337345

338346
### Move(direction=int:int)
339347

340348
Moves the bot one cell in a given direction, if possible. The delta values are
341-
signed integers. The permitted range values are "-1", "0" or "1".
349+
signed integers. The permitted values are `-1`, `0` or `1`.
342350

343351
Parameters:
344352

345-
* `direction` desired displacement for the move, e.g. '1:1' or '0:-1'
353+
* `direction` desired displacement for the move, e.g. `1:1` or `0:-1`
346354

347355
Example:
348356

349-
* "Move(direction=-1:1)" moves the entity left and down.
357+
* `Move(direction=-1:1)` moves the entity left and down.
350358

351359
Energy Cost/Permissions:
352360

@@ -362,15 +370,15 @@ position, expressed relative to the current position.
362370

363371
Parameters:
364372

365-
* `direction` desired displacement for the spawned mini-bot, e.g. '-1:1'
373+
* `direction` desired displacement for the spawned mini-bot, e.g. `-1:1`
366374
* `name` arbitrary string, except the following characters are
367-
not permitted: '|', ',', '=', '('
375+
not permitted: `|`, `,`, `=`, `(`
368376
* `energy` energy budget to transfer to the spawned mini-bot (minimum: 100 EU)
369377

370378
Defaults:
371379

372-
* `name` = "Slave_nn" an auto-generated unique slave name
373-
* `energy` = 100 the minimum permissible energy
380+
* `name` = `Slave_nn` an auto-generated unique slave name
381+
* `energy` = `100` the minimum permissible energy
374382

375383
Additional Parameters:
376384

@@ -380,12 +388,12 @@ Additional Parameters:
380388
allows a master bot to "program" a mini-bot with arbitrary starting parameters.
381389
* The usual restrictions for strings apply (no comma, parentheses, equals sign or pipe characters).
382390
* The following property names are reserved and must not be used for custom properties:
383-
"generation", "name", "energy", "time", "view", "direction", "master".
391+
`generation`, `name`, `energy`, `time`, `view`, `direction`, `master`.
384392
* Properties whose values are empty strings are ignored.
385393

386394
Example:
387395

388-
* `"Spawn(direction=-1:1,energy=100)"` spawns a new mini-bot one cell to the left and one cell
396+
* `Spawn(direction=-1:1,energy=100)` spawns a new mini-bot one cell to the left and one cell
389397
down, with an initial energy of 100 EU.
390398

391399
Energy Cost/Permissions:
@@ -407,7 +415,7 @@ immutable and delegating state maintenance to the server.
407415

408416
* The usual restrictions for strings apply (no comma, parentheses, equals sign or pipe characters).
409417
* The following property names are reserved and must not be used for custom properties:
410-
"generation", "name", "energy", "time", "view", "direction", "master".
418+
`generation`, `name`, `energy`, `time`, `view`, `direction`, `master`.
411419
* Properties whose values are empty strings are deleted from the state properties.
412420

413421
Energy Cost/Permissions:
@@ -433,6 +441,15 @@ Energy Cost/Permissions:
433441

434442

435443

444+
445+
446+
## Simulation-Neutral Commands
447+
448+
These commands, when executed by the server, do not alter the state of the game and
449+
do not affect the course of the simulation. They are primarily intended for debugging
450+
purposes.
451+
452+
436453
### Say(text=string)
437454

438455
Displays a little text bubble that remains at the position where it was created.
@@ -444,7 +461,7 @@ Parameters:
444461

445462
* `text` the message to display; maximum length: 10 chars; can be an
446463
arbitrary string, except the following characters are not
447-
permitted: '|', ',', '=', '('
464+
permitted: `|`, `,`, `=`, `(`
448465

449466
Energy Cost/Permissions:
450467

@@ -464,7 +481,7 @@ Parameters:
464481

465482
* `text` the message to display; maximum length: 20 chars; can be an
466483
arbitrary string, except the following characters are not
467-
permitted: '|', ',', '=', '('
484+
permitted: `|`, `,`, `=`, `(`
468485

469486
Energy Cost/Permissions:
470487

@@ -479,8 +496,8 @@ Displays a cell as marked. You can use this as a debugging tool.
479496

480497
Parameters:
481498

482-
* `position` desired displacement relative to the current bot, e.g. '-2:4' (defaults to '0:0')
483-
* `color` color to use for marking the cell (defaults to '#8888ff'), e.g. '#ff8800'
499+
* `position` desired displacement relative to the current bot, e.g. `-2:4` (defaults to `0:0`)
500+
* `color` color to use for marking the cell, using HTML color notation, e.g. `#ff8800` (default: `#8888ff`)
484501

485502
Energy Cost/Permissions:
486503

@@ -495,9 +512,9 @@ Draws a line. You can use this as a debugging tool.
495512

496513
Parameters:
497514

498-
* `from` starting cell of the line to draw, e.g. '-2:4' (defaults to '0:0')
499-
* `to` destination cell of the line to draw, e.g. '3:-2' (defaults to '0:0')
500-
* `color` color to use for marking the cell (defaults to '#ff8888'), e.g. '#ffffff' for a white line
515+
* `from` starting cell of the line to draw, e.g. `-2:4` (defaults to `0:0`)
516+
* `to` destination cell of the line to draw, e.g. `3:-2` (defaults to `0:0`)
517+
* `color` color to use for marking the cell, using HTML color notation, e.g. `#ff8800` (default: `#8888ff`)
501518

502519
Energy Cost/Permissions:
503520

5.87 KB
Binary file not shown.

0 commit comments

Comments
 (0)