An terribly written esolang inspired by BrainF*ck
Project description
d HolyShit
HolyShit | Random EsoLang
An Esolang inspired by brainfuck
350+ lines of code—brace yourself if you're diving into the source
Installation
Install the compiler using pip (coming soon): pip install HolyShit-esolang
Or clone the Git repository and install it locally: git clone https://github.com/bravestcheetah/HolyShit-esolang cd HolyShit-esolang pip install .
Executing Code
To execute code, first change the file extension (e.g., .py) to .geist. Then, use the HolyShit command to run the compiler:
HolyShit script.crap [-v | --verbal] [-d | --debug]
/ Run the script with optional verbosity
Alternatively:
hsEso script.crap [-v | --verbal] [-d | --debug]
This reads the code character by character and executes it. To learn how to write code, check out the next section.
Coding
HolyShit esolang is inspired by brainf**k and has a similar structure. Here's a list of all functions/features:
| Character | Functionality | Required Mode |
|---|---|---|
c |
Change mode to cursor mode | Cell mode |
s |
Change mode to cell mode | Cursor mode |
> |
Move the cursor one cell to the right | Cursor mode |
< |
Move the cursor one cell to the left | Cursor mode |
? |
Add one to cursor value | Cursor mode |
r |
Reset the cursor value (set to 0) | Cursor mode |
! |
Subtract one from cursor value | Cursor mode |
% |
Store the cursor value inside the selected cell | Cell mode |
~<number> |
Loop condition: specifies the value the cell beneath should have to end the loop | Both |
[ |
Start of a loop; ends when the cursor hovers over a cell with the loop condition value | Both |
] |
Close loop; code after executes when loop finishes | Both |
- |
If statement condition: runs if the cell value matches the cursor value | Both |
( |
Code block for an if statement | Both |
) |
Close an if statement | Both |
@ |
Print the value in the cell under the cursor | Cell mode |
# |
Take input from the user and store it in the cursor | Cursor mode |
/Text |
Comment: ignores everything after this character on the line during compilation | Both |
Examples
Examples can be found in the /examples folder.
Printing "Hello, World!"
To print "Hello, World!", store the ASCII values of each character. Below are the values:
| Character | ASCII Value |
|---|---|
| H | 72 |
| e | 101 |
| l | 108 |
| l | 108 |
| o | 111 |
| , | 44 |
| (space) | 32 |
| W | 87 |
| o | 111 |
| r | 114 |
| l | 108 |
| d | 100 |
| ! | 33 |
Step-by-Step Explanation
For each character:
- Enter cursor mode (
c) to edit the cursor value. - Use a loop (
~<value>[...]) to increment the cursor value until it matches the ASCII value. - Switch to cell mode (
s) and store the cursor value (%). - Switch to cell mode again to print (
@) the stored value. - Reset the cursor (
r) after printing and repeat for the next character.
Example for 'H' (ASCII 72):
c / Enter cursor mode
~72[?s%c] / Increment cursor to 72, switch to cell mode and store the value
s@ / Switch to cell mode and print 'H'
Combine all characters:
c~72[?s%c]s@cr~101[?s%c]s@cr~108[?s%c]s@@cr~111[?s%c]s@cr~44[?s%c]s@cr~32[?s%c]s@cr~87[?s%c]s@cr~111[?s%c]s@cr~114[?s%c]s@cr~108[?s%c]s@cr~100[?s%c]s@cr~33[?s%c]s@cr~10[?s%c]s@
/ Prints each character of "Hello, World!" by incrementing values and switching modes
Note: The "l" character is printed twice instead of looping multiple times.
Taking Inputs
Take the ASCII value of one character using #:
c#s% / Enter cursor mode, take user input, and store it in a cell
To print the input:
c# / Take input (ASCII value of one character)
s% / Store input in cell
@ / Print value inside the cell
Shortened to:
c#s%@ / Take input, store it in a cell, and print it
For multiple inputs, use cursor movement:
c#s% / Take input and store it in the cell
c> / Move to the next cell
c#s% / Next input
c> / Move to the next cell
c#s% / Last input
<< / Go back to the first cell
s@c>s@c>s@ / Print each character and move to the next cell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file holyshit_eso-1.0.2.tar.gz.
File metadata
- Download URL: holyshit_eso-1.0.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adf68a1c310bf7817a8e683b8aacdec05ea6a3075e0a5eaa31b1a04fe6bee53f
|
|
| MD5 |
d60b90940b5aeb137f0401615b44a5c9
|
|
| BLAKE2b-256 |
8dee9f7b7c3e1d698429075f22b1c4250c501bd7b6e7a2fd870982cc743f3ce9
|
File details
Details for the file holyshit_eso-1.0.2-py3-none-any.whl.
File metadata
- Download URL: holyshit_eso-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d99ecb1f566d43a3c6acbce8c488213c217085fae12de62d3244309a8c019254
|
|
| MD5 |
76cc60baffd5e10f1c4db933e2a94285
|
|
| BLAKE2b-256 |
badd0dfe40a4013d90c1820e0dbfe8355506828d4a7cda56c154f53eb36ea78f
|