Skip to content

Commands Cheat Sheet

noahyor edited this page Jan 31, 2022 · 24 revisions
Syntax Type Capability Description
wait int -> cmd () None Wait for some number of time steps without doing anything.
noop cmd () None 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 () None Emit a message.
log string -> cmd () None? Log the string passed to log in the logger
view string -> cmd () None View a certain robot.
appear string -> cmd () Appear Set what characters are used for display.
create string -> cmd () Create Create an entity (non-robot) 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 None See if a specific entity is here. (This may be removed.)
random int -> cmd int Random Get a uniformly random integer.
run string -> cmd () None Run a program loaded from a file.
not bool -> bool None 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 None First projection.
snd ∀ a b. a * b -> b None Second projection.
return ∀ a. a -> cmd a None Return for the cmd monad.
try ∀ a. cmd a -> cmd a -> cmd a None Try/catch block.
raise ∀ a. string -> cmd a Raise an exception.
Clone this wiki locally