Heebolang

From Esolang
Jump to navigation Jump to search

Heebolang is an esolang created by User:Polybagel, which is very similar to esolangs like brainfuck, with the sole intention of being as hard to read and as hard to write as possible, using similar looking characters for different commands.

Heebolang code is created from a short list of commands and is all written in a single line. Memory is stored in an integer array of length 256, which can be indexed by shifting the memory index.

Commands

Command Description
, Shift the Memory Register Right
. Shift the Memory Register Left
: Decrement the Currently Indexed Memory Value
; Increment the Currently Indexed Memory Value
= Get Single Keyboard Input And Store it in the Current Cell
( Loop Starting Point
) If the Currently Indexed Memory Value is 0, Ignore This Character, Otherwise, Go Back to the Loop Starting Point
` Print the Currently Indexed Memory Value as an Integer
- Print the Currently Indexed Memory Value as the Corresponding ASCII Character
R Reads Data From a File and Puts it Into the Currently Indexed Memory
W Writes Data From the Currently Indexed Memory Into a File
[ Opening Character For File Path
] Closing Character For File Path
& Clear the Canvas
@ Render the Canvas
P Paint Pixel
{ Opening Character for Graphics Coordinate Declaration
} Closing Character for Graphics Coordinate Declaration
| Graphics Coordinate Declaration Separating Character

Sample Code

This code is a looping counter, meaning it will continuously count up from 0 to infinity until you exit the program.

(;`)

output:
1
2
3
4
5
6
7
...
100
...
1000
...
infinity

This code will count down from 10 to 0.

;;;;;;;;;;`(:`)

output:
10
9
8
7
6
5
4
3
2
1
0

This code will read data from a text file, store it in the currently indexed memory cell, and print out the result.

R[file.txt`]

This code will take data from the currently indexed memory cell and write it to a file.

W[file.txt]

This code will draw a diagonal line starting from coordinate (10,10) and going to the top left corner and stopping.

&;;;;;;;;;;(P{i|i}@:)

History

Heebolang was created because I was bored on a Sunday night and decided to load up Visual Studio and fuck around.

How Keyboard Input Works

Keyboard input is quite simple, simply dictated by one command.

=

When the interpreter sees this command, the program will pause and wait for a single keyboard input. You will need to press enter to confirm your input, but after you've done that, it will store the ASCII decimal value into the currently indexed cell.

P.S: The program will not resume until you've inputted a character.

P.P.S: Heebolang will accept more than one character for the input, but it will only look at the first character, and ignore the rest. So if you type "Hello World" into the input box, the program will only consider the first character, 'H'.

How File IO Works

File IO is quite simple in Heebolang, with only reading and writing functionality.

Reading a file can be done with the following code:

R[file.txt]

The "R" character tells Heebolang to prepare to load data from a file. Everything in the '[]' will be treated as a local file path. If you want to specify a full filepath instead, just put in the entire path like this:

R[C:\Users\Username\Desktop\file.txt]

For writing to files, the process is quite similar:

W[file.txt]

This code will simply write the contents of the currently indexed memory cell to a file.

How Loops Work

A loop is declared with "(" as the opening character.

Heebolang will run all code that is in front of "(" and behind ")", unless the currently indexed memory value is 0, then Heebolang will just continue moving through the code.

How Graphics Commands Work

The only currently supported graphics commands are plotting of single pixels, clearing the canvas, and rendering the canvas. The width and height of the canvas itself is 15x30. Support for adjusting this beforehand will be added in the future.

To plot a pixel, it's probably a good idea to clear the canvas.

&

Next, you need to type P, the pixel command, followed by { and }.

P{6|8}

As you may have been able to figure out, the 6 and 8 are the X and Y coordinates of the pixel, separated by the pipe character. |

If you want to pass in a memory value as a coordinate, all you need to do is put an i character in place of a number.

P{i|4}

And finally, when you're ready to render what you've plotted, simply use the render canvas character.

@

Combining all of these aspects together might look something like this:

&;;;;;(P{i|2}:)@

Github Source Code and Interpreter Download

Github Source Code and Interpreter Download