Skip to content

Commit

Permalink
Add few more highlights and make TIPs bold
Browse files Browse the repository at this point in the history
  • Loading branch information
xsebek committed Aug 13, 2023
1 parent a100df9 commit 21ab251
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion data/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
description:
- A robot with a boat equipped can float on top of water without drowning.
- |
Note: most devices are automatically equipped on robots that
**NOTE:** most devices are automatically equipped on robots that
will require them; but this doesn't work in the case of boats since floating is not
associated with any particular command. To manually ensure a boat is equipped on
a robot, just add the special command `require "boat"` to the robot's program.
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Challenges/Ranching/gated-paddock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ objectives:
create specialDrill;
equip specialDrill;
// NOTE: System robots can walk on water
// **NOTE:** System robots can walk on water
// so we only need this if we want to
// demo the algorithm with a player robot.
// create "boat";
Expand Down
4 changes: 2 additions & 2 deletions data/scenarios/Tutorials/bind2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ objectives:
- |
Build a robot to retrieve and restore the mystery artifact to its proper place!
- |
Note: If you find yourself stuck, you can select "Start over" from
**NOTE:** If you find yourself stuck, you can select "Start over" from
the "Quit" (**Ctrl+Q**) dialog.
condition: |
try {
Expand All @@ -38,7 +38,7 @@ objectives:
For example, `grab` has type `cmd text`{=type}, and returns the name of the
grabbed entity as a text value.
- |
To use the result of a command later, you need "bind notation", which
To use the result of a command later, you need _bind notation_, which
consists of a variable name and a leftwards-pointing arrow
before the command. For example:
- |
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Tutorials/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ objectives:
Build a robot to harvest the `flower`{=entity} and place it next
to the `water`{=entity}.
- |
TIP: Newly built robots start out facing the same
**TIP:** Newly built robots start out facing the same
direction as their parent, which in the tutorials will always be north.
condition: |
try {
Expand Down
4 changes: 2 additions & 2 deletions data/scenarios/Tutorials/conditionals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ objectives:
must also be in curly braces: the type of `build`
is `{cmd a} -> cmd robot`{=type}.
- |
TIP: Note that `if` requires a `bool`{=type}, not a `cmd bool`{=type}! So you cannot directly say
**TIP:** Note that `if` requires a `bool`{=type}, not a `cmd bool`{=type}! So you cannot directly say
`if (ishere "very small rock") {...} {...}`{=snippet}.
Instead you can write `b <- ishere "very small rock"; if b {...} {...}`{=snippet}.
You might enjoy writing your own function of
type `cmd bool -> {cmd a} -> {cmd a} -> cmd a`{=type} to encapsulate this pattern.
- |
TIP: the two branches of an `if` must have the same type. In particular,
**TIP:** the two branches of an `if` must have the same type. In particular,
`if ... {grab} {}`{=snippet} is not
allowed, because `{grab}` has type `{cmd text}`{=type} whereas `{}` has type `{cmd unit}`{=type}.
In this case `{grab; return ()}` has the right type.
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Tutorials/craft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ objectives:
- Your goal is to make a `branch predictor`{=entity}, so you will have to make
some `branch`{=entity}es first.
- |
Note: when used after opening quotes in the REPL, the Tab key can cycle through
**NOTE:** when used after opening quotes in the REPL, the Tab key can cycle through
possible completions of a name. E.g., type:
- |
`> make "br[Tab][Tab]`{=snippet}
Expand Down
6 changes: 3 additions & 3 deletions data/scenarios/Tutorials/def.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ objectives:
use of new definitions, it should be possible to complete this challenge
in just a few lines of code.
- |
TIP: your base is at coordinates `(0,0)`, and the `flower`{=entity} is at `(16,4)`, which
**TIP:** your base is at coordinates `(0,0)`, and the `flower`{=entity} is at `(16,4)`, which
you can confirm by clicking in the world map panel. When you click on a cell,
its contents and coordinates are shown in the lower left.
- |
TIP: the type annotation in a definition is optional. You could also write
**TIP:** the type annotation in a definition is optional. You could also write
`def m4 = move; move; move; move end`{=snippet}, and Swarm would infer
the type of `m4`{=snippet}.
- |
TIP: writing function definitions at the prompt is annoying.
**TIP:** writing function definitions at the prompt is annoying.
You can also put definitions in a `.sw`{=path} file and load it
with the `run` command. Check out
https://github.com/swarm-game/swarm/tree/main/editors
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Tutorials/farming.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ objectives:
a field of `lambda`{=entity}s and then program one or more robots to
harvest them in an automated way.
- |
TIP: the `ishere` command can be used to test for the presence of a
**TIP:** the `ishere` command can be used to test for the presence of a
(fully-grown) `lambda`{=entity}, and the `has` command can be used to test whether
a robot has a `lambda`{=entity} in its inventory.
condition: |
Expand Down
2 changes: 2 additions & 0 deletions data/scenarios/Tutorials/move.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ objectives:
- |
Previously you could move twice by chaining the move command:
- |
```
move; move
```
- To reuse that command without having to retype it press the upward
arrow on your keyboard. This will allow you to select previous commands.
- Ahead of you is a six steps long corridor. Move to its end, i.e. the
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Tutorials/place.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ objectives:
- Your goal is to collect 6 `spruce`{=entity} trees. You can speed this up
by planting more trees.
- |
TIP: You can get a sneak peak at a feature we will explain later and type:
**TIP:** You can get a sneak peak at a feature we will explain later and type:
```
def t = move; place "spruce"; harvest; end
```
Expand Down
2 changes: 1 addition & 1 deletion data/scenarios/Tutorials/types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ objectives:
its type will be displayed in gray text at the top right of the window.
- For example, if you try typing `move`, you can see that it has
type `cmd unit`{=type}, which means that `move` is a command which
returns a value of the unit type (also written `()`).
returns a value of the `unit`{=type} type (also written `()`).
- As another example, you can see that `turn` has type `dir -> cmd unit`{=type},
meaning that `turn` is a function which takes a direction as input
and results in a command.
Expand Down
4 changes: 2 additions & 2 deletions data/scenarios/Tutorials/world101.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ objectives:
- Now that you have a harvester, you can use `harvest` instead of `grab`
whenever you pick up a growing item (check for the word "growing" at the
top of the item description), to leave behind a seed that will regrow.
- "TIP: since you only have a single harvester device for now, whenever you
- "**TIP:** since you only have a single harvester device for now, whenever you
send out a robot to harvest something, try programming it to come back
to the base when it is done. Then, execute `salvage` to get the harvester
back, so you can reuse it in another robot later."
- One of the next things you will probably want is a `lambda`{=entity}, so you can
define and use parameterized commands. Scan some things and use
the process of elimination to find one. Since lambdas regrow,
once you find one, try getting it with `harvest`.
- "TIP: remember that you can click on cells in the world to see their
- "**TIP:** remember that you can click on cells in the world to see their
coordinates."
condition: |
try { as base {has "lambda"} } {return false}
Expand Down

0 comments on commit 21ab251

Please sign in to comment.