Skip to content

Commands Cheat Sheet

Ondřej Šebek edited this page Oct 3, 2021 · 24 revisions
Syntax Type Capability Description
wait cmd () Wait for one time step without doing anything.
noop cmd () Do nothing. This is different than 'Wait' in that it does not take up a time step.
selfdestruct cmd () Selfdestruct Self-destruct.
move cmd () Move Move forward one step.
turn dir -> cmd () Turn Turn in some direction.
grab cmd string Grab Grab an item from the current location.
scan dir -> cmd () Scan Scan a nearby cell.
upload string -> cmd () Upload Upload knowledge to another robot (base for example).
place string -> cmd () Place Try to place an item at the current location.
give string -> string -> cmd () Give Give an item to another robot at the current location.
install string -> string -> cmd () Install Install a device on a robot.
make string -> cmd () Make Make an item.
build ∀ a. string -> cmd a -> cmd string Build Construct a new robot.
say string -> cmd () Emit a message.
view string -> cmd () View a certain robot.
appear string -> cmd () Appear Set what characters are used for display.
create string -> cmd () Create Create an entity out of thin air. Only available in creative mode.
getx cmd int Senseloc Get the current x-coordinate.
gety cmd int Senseloc Get the current y-coordinate.
blocked cmd bool Sensefront See if we can move forward or not.
ishere string -> cmd bool See if a specific entity is here. (This may be removed.)
random int -> cmd int Random Get a uniformly random integer.
run string -> cmd () Run a program loaded from a file.
not bool -> bool Logical negation.
==, /=, <=, >=, <, > bool -> bool -> bool Compare Binary comparison operators.
- int -> int -> int Arith Arithmetic negation.
^, *, /, +, - int -> int -> int Arith Binary arithmetic operators.
if ∀ a. bool -> a -> a -> a Cond If-expressions.
fst ∀ a b. a * b -> a First projection.
snd ∀ a b. a * b -> b Second projection.
return ∀ a. a -> cmd a Return for the cmd monad.
try ∀ a. cmd a -> cmd a -> cmd a Try/catch block.
raise ∀ a. string -> cmd a Raise an exception.
Clone this wiki locally