Fungraph

From Esolang
Jump to navigation Jump to search

Fungraph is an esolang invented by User:None1. It is Befunge, but the code is not a grid but a graph.

Graph

The graph in Fungraph has labeled and weighted nodes, which contain commands and node id (1-indexed) formatted like nodeid-command. It also contains weighted directed edges, which contain directions (unique integers between 0 and the out-degree of the start node of the edge minus one). Every node in the graph must have an out-degree of at least 1, even if it is a halting command.

After a command is executed, the IP travels through the edge weighted d%n, where d is the direction and n is the out-degree of the node the IP is at.

Commands

Most commands in Fungraph are the same, except direction-changing commands and self-modifying commands.

<, >, ^ and v

These commands are combined into one command: vinteger, which changes the direction of IP to integer.

| and _

These commands are combined into one command as well: integer1_integer2, which changes the direction of IP to integer1 if stack top is nonzero, otherwise integer2.

?

The ? command changes the direction of IP to a random integer between 0 and the out-degree of the node the IP is at minus one.

g

This commands now only needs to pop one number: The node id to get.

p

This commands now only needs to pop two numbers: The node id to put and the value to put.

See also