Due to limitation of the interpreter using, AlgoVis only has a C-like API. The user receives opaque objects and functions have to be used even for simple data-retrieval.
Therefore one has to write listSize(list)
instead of simply writing list.size
or list.getSize()
.
A new interpreter or a transpiler that could convert the latter to the former could be a possible solution.
Objects are always referenced by their name, a string.
Creates a new shuffled list with the specified name and size. Returns
name
.
Returns the ith element of
list
Sets the ith element of
list
tovalue
Swaps the ath and bth elements of
list
Appends
value
tolist
Returns the size of
list
Returns the size of
list
Creates a new tree with the specified name and one root node with a value of 0.
Creates a new random tree with the specified name, a maximum branch depth of
depth
, with children as many asmaxChildCount
.
Same as above with maxChildCount = 2
Returns the root node of
tree
Returns the left child of
node
. Synonymous withnodeGetChild(node, 0)
Returns the right child of
node
. Synonymous withnodeGetChild(node, 1)
Sets the left children's value of
node
tovalue
.
Sets the right children's value of
node
tovalue
.
Sets the left children to the node referenced by
ref
Sets the right children to the node referenced by
ref
Removes the left children of
node
Removes the right children of
node
Returns the value of
node
.
Sets the value of
node
tovalue
.
Removes the amount of children of node
Returns a reference to the ith child of
node
Adds a new child-node to
node
with the valuevalue
Creates a new queue with name
name
Appends
obj
to the queueq
Returns the object that is first in the queue.
Returns the amount of objects in the queue
q
Creates a new empty graph. Returns
name
.
Returns the amount of edges of
graph
Returns the amount of vertices of
graph
Returns the ith edge of
graph
Creates a new vertex and adds it to the graph. Returns
name
.
Returns the ID of
vertex
Returns the weight of
edge
Returns the source vertex reference of
edge
Returns the destination vertex reference of
edge
Prints
msg
to the console
Stops execution until it is resumed again