Making an esolang

javacode7

JavaCode7

Posted on June 1, 2021

Making an esolang

I have posted about esolangs a lot in the past. From good ones to mine to the esolist but never have I posted about making one.

In this article, I am going to go through a step by step procedure to make an esolang like loo. It is a simple language with only 4 commands. + to increment the value of the one variable it can hold, - to decrement, # to print out the value in ascii form (e.g. 97 would be the lowercase letter a) and finally ; stops the program. I will be making this in python but you can use any language you like.

Note

This is not the only way to create an esolang and it is not the only syntax for one. There are many types, each with their own peculiarities. I recommend looking at esolangs.org to see these.

Step 1: Accepting the code

This code takes in input from the user that should contain the loo code. It also sets up the variable for the value that loo holds.

value = 0
code = input("Enter your loo code here please > ")
Enter fullscreen mode Exit fullscreen mode

Step 2: String to List

This block of code basically splits the loo code string into a list that will be iterated through later.

lexed = []
for i in code:
    lexed.append(i)
Enter fullscreen mode Exit fullscreen mode

Step 3: Execution

Now we iterate through the lexed list and execute the code.

for j in lexed:
    if j == "+":
        value += 1
    elif j == "-":
        value -= 1
    elif j == "#":
        print(chr(value))
    elif j == ";":
        quit()
Enter fullscreen mode Exit fullscreen mode

It is as simple as that! I hope you enjoyed this and hopefully I will post again soon.

💖 💪 🙅 🚩
javacode7
JavaCode7

Posted on June 1, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

I make you an esolang
esolang I make you an esolang

June 9, 2021

Improving the esolang
esolang Improving the esolang

June 5, 2021

Making an esolang
esolang Making an esolang

June 1, 2021

BAL - Designed for hardware
esolang BAL - Designed for hardware

May 15, 2021