MindVomit

From Esolang
Jump to navigation Jump to search

MindVomit is an esoteric interpreted programming language designed by Mayedl10 on GitHub. Its syntax is inspired by the famous "Brainfuck" language. MindVomit was designed as a "Brainfuck+-". This means it has more features than Brainfuck, but more limitations as well.

Instructions

As of the 03.11.2022 the language currently is on version 1.4.0. Its main parts are the memory and the pointer. The memory is an array with 32768 "slots". Each slot can have a value from 0 to 255 and is 0 by default. The pointer manages which part of memory can be manipulated. Its position is 0 by default. There is only ONE available variable. If the program contains an input-instruction, it will ask the user for input when the input-instruction gets executed.

The operators in version 1.3.0

  • ">" Moves the pointer one slot to the right.
  • "<" Moves the pointer one slot to the left
  • "+" Adds 1 to the value of the slot the pointer is pointing to. If the slots value is 255, "+" sets it to 0.
  • "-" Subtracts 1 from the value of the slot the pointer is pointing to. If the slots value is 0, "-" sets it to 255.
  • "o" Outputs the corresponding ASCII-character of the slot at the pointers position.
  • "b" Resets the pointers position to 0.
  • ":" Moves the pointer to the value of the currently selected slot.
  • ";" Sets the currently selected slots value to its position. If the position is bigger than 255, the slot will obtain the value 0.
  • "z" Sets the currently selected slots value to "0".
  • "r" Resets every slot in memory to "0".
  • "g" Sets the only available variable to the currently selected slots value.
  • "w" Sets the currentyl selected slots value to the variables value.
  • "n" Enters a new line in output.
  • "~" Sets the goto-entry-point at this position in code.
  • "#" Jumps to the last created goto-entry-point in code
  • "i" Works differently in different versions.


  • In versions lower than 1.3.0, if there is an "i", the interpreter gets input before running the code. The input is then stored in a constant. The constant's value gets pasted onto the memory at the current pointer position if an "i" is used in the code.
  • In versions 1.4.X and higher, an "i" sets the currently selected slots value to an input-integer in range 0-255.The data gets input at the time the "i" in the code gets executed.


If-statements

  • "L" opens an if-statement
  • "J" closes an if-statement
  • The code inside an if statement only runs if the currently selected slot at the "L" is not "0".

Loops

  • "(" signals the opening of a loop. Corresponds to ")".
  • ")" signals the closing of a loop. Corresponds to "(".
  • "[" same as "(" but corresponds to "]"
  • "]" same as ")" but corresponds to "["
  • "{" same as "(" but corresponds to "}"
  • "}" same as "}" but corresponds to "}"

This means there can only be 3 layers of nested loops. When initialising a loop by using one of the opening brackets, the program "remembers" the slot at pointers position. The loop keeps executing until this slot reaches 0.

Closing Characters

  • "x" a character that quits the execution of a programm.
  • "?" a character that converts the programm into an endless loop.

The last symbol in a script must always be one of these closing-characters. They can be placed anywhere in the code but one of them must be the last character of any script. "x" can be useful when using if-statements.

Examples

  • "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ox" outputs "H"
  • "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++o+o----------------------------------------ox" outputs "HI!"
  • "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++go>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og> w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+ogx" outputs the alphabet in capital letters.
  • "igo>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+og>w+ogx" outputs the alphabet in capital letters if the constant is assigned as "65"
  • "+++++++(>++++++++++o<-)x" outputs "¶▲(2<F"
  • "L++++++++++++++++++++++++++++++++++oJx" wont output anything because the currently selected slot is "0" while the interpreter is looking at the "L"
  • "+L++++++++++++++++++++++++++++++++++oJx" will output "#" because the currently selected slot is not "0" while the interpreter is looking at the "L"

Commands in the interpreter

  • "run " executes the programm from a file (I like the .mvt file extension because of MindVomiT but this should work with .txt files as well)
  • "exit" exits the interpreter.
  • "getMemory" prints the entire memory to the console. only works after a programm is executed. "run" always resets memory.
  • "help" prints help for all commands
  • "iterMemory" iterates through the memory the last program left behind and outputs the position in memory of every non-zero value.

Getting started

  • Go to MindVomit's Github repository and download a version of the interpreter.
  • Create a file with the ".mvt" file-extension.
  • Write your code.
  • Open the interpreter.
  • Type "run" and the path to your file.