A downloadable fictional computer for Windows, macOS, and Linux

The Graph-Oriented Fictional Computer is an emulator of a fictional computer that uses a graph instead of linear memory. Each node in the graph can store 1 byte of memory, however using child nodes it is possible to store strings as well as 8-byte integers and fractions (like double variables in Java). The way this is done is using the child node C (the first letter of the word continuation), then child C of child C, and so on. This can be done automatically using commands such as SET_STRING, SET_BIG_ENDIAN, etc., however it's possible to break it by overriding the bytes with something else.

It can be treated as an esoteric programming language or two closely related esoteric programming. 

The first "language" is the commands you type in the command line of the fictional computer in order to read from the graph or to write to it. You can also type many commands in a txt file, and pass the name of the file as an argument to the program in the command line of your actual computer.

The second language is a programming language where the commands are stored in the graph. Each command has a unique number, for example 0 is no-operation, and does nothing. Command 20 is ADD, and takes 3 parameters. The first two are addresses where the one byte numbers we want to add a stored, and the third is the address of the destination node where we want to store the result. In the graph the first parameter is read from child A of the command, the second from child B, and so on. The next command is usually stored in child I (the first letter of the word instruction). In the case of condition commands, the code will branch depending on the condition.

You can type the command HELP in order to get useful information about the fictional computer, and you can type MAN to see a list of command. All commands that can be typed in the command line are written by all-capital letters, and all commands that can be executed from the graph have numbers. The majority of commands can be executed both from the command line and from the graph, however some commands can only be executed from the command line or only from the graph. You can also type MAN followed by the name or the number (in the case of commands which  have a number) of a command in order to read useful information about this command.

You can build a graph with your program by typing commands in the command line manually, but it can get exhausting, especially if you make mistakes. It is recommended to type the commands to create the program in a txt file and run the emulator from the command line of your actual computer with the name of the file as a parameter. The command RUN will read the first command from node I, and continue executing the program in the graph until it has reached the end. If node I does not exits, the command RUN will do absolutely nothing.

Three example codes are available for downloading together with the emulator. The first one asks the user to enter a number, calculates factorial of that number, and prints it. The second one prints numbers from the Fibonacci sequence. The third one prints useful information about The Graph-Oriented Fictional Computer by running the command HELP, then MAN to print a list of all commands, and then MAN with each one of the commands in order to print information about every one of the commands. Notice that is an example of self-modifying code.

Download

Download
GraphOrientedFictionalComputer.jar 55 kB
Download
factorial.txt 757 bytes
Download
fibonacci.txt 532 bytes
Download
info.txt 1 kB

Install instructions

Download the jar file, and run it. You can also run it from the command line of your computer, and give it as a parameter the name of a text file containing commands to execute before control is given to the user.

Leave a comment

Log in with itch.io to leave a comment.