Graphwalk

From Esolang
Jump to navigation Jump to search

Graphwalk is an esoteric programming language based on a graph.

Syntax

The syntax is really symple: it's just a graph.

the precise format:

N S
action1 D1 B1,1 ... B1,D1
action2 D2 B2,1 ... B2,D2
...
actionN DN BN,1 ... BN,DN

That is, first comes the total number of nodes and the starting node, then one line for each node containing the action to do and the nodes to go to.

for example:

4 1
` 3 1 4 2
` 2 2 1
+2 1 4
` 3 0 2 3

means the graph

Graph.png

Actions

let X be the current node, starts at S.

each node has a internal counter, which starts at 0.

going out of bounds will halt.

the process is:

  • do the action stated
  • compute the counter's value modulo DX, and call it A
  • increment the counter
  • go to BX,A.

the actions:

Caption text
action meaning
+x add node x's counter by 1
p prints the current node's counter value modulo 256 as a character
n prints the current node's counter value as number
` NOP (operation)
?x>y TBD

Computational class

It is of course a Finite-state machine.