Skip to content

Commit

Permalink
Some small updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Apr 27, 2024
1 parent d749c5e commit a4e4429
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 4 additions & 1 deletion data/entities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@
The infix operator `++ : text -> text -> text`{=snippet}
can be used to concatenate two text values. For example,
- |
"Number of widgets: " ++ format numWidgets
```
let numWidgets = 42
in "Number of widgets: " ++ format numWidgets
```
properties: [pickable]
capabilities: [concat]
- name: caliper
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 @@ -40,7 +40,7 @@ objectives:
of type, say, `{int}`{=type}, we just surround a value of type `int`{=type}
in curly braces, like `{3}`. This is why arguments to `build`
must also be in curly braces: the type of `build`
is `{cmd a} -> cmd robot`{=type}.
is `{cmd a} -> cmd actor`{=type}.
- |
**TIP:** Note that `if` requires a `bool`{=type}, not a `cmd bool`{=type}! So you cannot directly say
`if (ishere "very small rock") {...} {...}`{=snippet}.
Expand All @@ -50,7 +50,7 @@ objectives:
- |
**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}.
allowed, because `{grab}` has type `{cmd text}`{=type} whereas `{}`{=snippet} has type `{cmd unit}`{=type}.
In this case `{grab; return ()}` has the right type.
condition: |
try {
Expand Down
12 changes: 8 additions & 4 deletions data/scenarios/Tutorials/crash-secret.sw
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ end;

log "Hi, I am secret";
iterate allOK (tryGive
$ "Send a robot to `salvage` me and come back to `give base \"Win\"`.\n"
++ "When the rescue robot stands where I am and executes `salvage`,\n"
++ "all my inventory and logs will go to it, including the \"Win\".\n"
++ "Once you have brought the \"Win\" to your base, you will win!"
$ "Send a robot to `salvage` me and come back to\n"
++ "`give base \"Win\". When the rescue robot stands\n"
++ "where I am and executes `salvage`, all my inventory\n"
++ "and logs will go to it, including the \"Win\". Once you\n"
++ "have brought the \"Win\" to your base, you will win!\n\n"
++ "NOTE: if you are still viewing me when I am salvaged,\n"
++ "you will be in for a surprise! If this happens just\n"
++ "type `view base` to return to viewing your base."
)
2 changes: 1 addition & 1 deletion src/Swarm/TUI/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ helpWidget theSeed mport =
, ("Ctrl-o", "single step")
, ("Ctrl-z", "decrease speed")
, ("Ctrl-w", "increase speed")
, ("Ctrl-q", "quit the current scenario")
, ("Ctrl-q", "quit or restart the current scenario")
, ("Ctrl-s", "collapse/expand REPL")
, ("Meta-h", "hide robots for 2s")
, ("Meta-w", "focus on the world map")
Expand Down

0 comments on commit a4e4429

Please sign in to comment.