Skip to content

Commands Cheat Sheet

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