In this text, I’ll cowl the best coding language to discover ways to make something! It’s referred to as Emojicode. Created in 2014 by Theo Belaire, Emojicode is an open supply programming language that makes use of emoji characters to signify its syntax. When working in Emojicode, emoji are used to create variables, features, and management buildings. Because it is a statically typed language, variable varieties have to be declared earlier than use, nevertheless it additionally helps object-oriented ideas like lessons and inheritance. This language will be run on each OS, and it is a tremendous enjoyable strategy to code, particularly in case you’re a non-native English speaker. This is useful as a result of pictographic representations can carry us all collectively and permit us to talk the identical language in a approach just like math.
Prerequisites
In this tutorial, I’m utilizing a Debian-based OS. My instruments could also be totally different than what your OS might require. Here’s what I’m utilizing:
- Geany, an open supply IDE for Linux.
- IBus, which lets you choose emoji and place them in your editor. The interface I’m utilizing known as emoji picker.
- Debian-based Linux.
- A C++ compiler. I’m utilizing the
g++
compiler. - Emojicode
I’m utilizing a Linux OS, however you’ll be able to read the docs to find out about any particular steps you would possibly have to take to apply it to one other OS.
Intall Emojicode on Linux
There are a pair methods to put in Emojicode in your laptop, however they’ve a cool magic install page that may let you know precisely what to do. Here’s what I did:
$ wget https://github.com/emojicode/emojicode/releases/download/v1.0-beta.2/Emojicode-1.0-beta.2-Linux-x86_64.tar.gz -O emojicode.tar.gz
&& tar -xzf emojicode.tar.gz && rm emojicode.tar.gz
&& cd Emojicode-1.0-beta.2-Linux-x86_64 && ./set up.sh
&& cd .. && rm -r Emojicode-1.0-beta.2-Linux-x86_64
This is the output of that command.
Now that you’ve all the things put in, it is time to transfer on to some code!
How does this complete factor work?
To begin, all Emojicode file extensions finish in filename.๐ however as a result of you’ll be able to’t try this in your common file identify, it interprets to filename.emojic
. Here are crucial syntax parts:
- Put ๐ in the beginning of a line to point what blocks of code are supposed to be executed
- Start a block of code with ๐
- End a block of code utilizing ๐
- Want to print one thing? Just use ๐ ๐ค
<string>
๐ค โ
There’s far more to it, so listed here are some sensible examples.
Print a haiku
First up, attempt printing a pleasant haiku for enjoyable! I’ll add a single remark on this instance. See in case you can determine it.
๐๐
๐ญ This is a single line remark for enjoyable
๐ ๐คEmojicode is nice,๐ค โ
๐ ๐คFun and expressive code,๐ค โ
๐ ๐คno disappointment, simply pleasure.๐ค โ
๐
Now we have to save our code and run it via our compiler to make a pleasant executable file:
$ emojicodec haiku.emojic
$ ls
haiku haiku.emojic haiku.o
As you’ll be able to see, the code has been compiled and generated two recordsdata, one in every of which is executable. Run the haiku
file:
$ ./haiku
Emojicode is nice,
Fun and expressive code,
no disappointment, simply pleasure.
Math and variable manipulation
Next up, you are going to do a few issues without delay: slightly little bit of math and the altering of the variable. Start by assigning a variable to 0:
0 โก๏ธ ๐๐x
You simply created a brand new variable by utilizing the crayon emoji, and the brand new emoji subsequent to the variable identify, whereas additionally assigning that variable to 0.
Next, print a line that features the variable utilizing the magnets emoji:
๐ ๐คThe worth is ๐งฒx๐งฒ ๐ค โ
Next, change the variable utilizing the plus signal and arrow emojis:
x โฌ
๏ธโ 1
Then print one other line with the worth. I proceed this for some time and print the ultimate worth. Here’s what I did:
๐ ๐
๐ญUpdating a variable utilizing math
0 โก๏ธ ๐๐x
๐ ๐คThe worth is ๐งฒx๐งฒ ๐ค โ
x โฌ
๏ธโ 1
๐ ๐คThe worth is ๐งฒx๐งฒ ๐ค โ
x โฌ
๏ธโ 15
๐ ๐คThe worth is ๐งฒx๐งฒ ๐ค โ
x โฌ
๏ธโ 9
๐ ๐คThe worth is ๐งฒx๐งฒ ๐ค โ
x โฌ
๏ธโ 2
๐ ๐คThe remaining worth is ๐งฒx๐งฒ ๐ค โ
๐
Next, compile the code utilizing emojicodec
, after which use your executable code to see the end result:
$ emojicodec math.emojic
$ ./math
The worth is 0
The worth is 1
The worth is 16
The worth is 7
The remaining worth is 3
As you’ll be able to see, all the things printed out because the variable was up to date with the brand new math. You can take this even additional with the numerous mathematic emojis out there. Here are just some extra operators:
๐ฎ is your modulo
โ Less than
โถ Greater than
โ๐ lower than or equal to
โถ๐ larger than or equal to
Emojicode quirks
While I used to be bouncing across the docs, I discovered some attention-grabbing quirks. One of these is that whereas grabbing enter from a person, the pores and skin tone of the ear issues resulting from some identified compiler subject.
The motion for getting person enter is that this:
๐๐กโถ๏ธ๐๐ผโ๏ธ
The motion for getting and assigning person enter is that this:
๐๐กโถ๏ธ๐๐ผโ๏ธ โก๏ธ inputText
I used to be trying to get that to work however was having some points with my compiler when I discovered that. You can also run into some small issues right here and there. If you do, make sure to create an issue, so it has an opportunity of being mounted.
No methods, simply nice code
While I may undergo a lot extra, I can guarantee you the docs behind this superb code are very intensive. Even although I used to be impressed to jot down this text only for enjoyable in time April Fool’s Day, I’ve to confess this is without doubt one of the greatest languages ever made as a result of it teaches you numerous about very actual programming ideas. I earnestly recommend this as a enjoyable strategy to educate a few of your pals, children, or possibly a classmate, who’s excited about coding. Hopefully, you may have a fun-filled April Fool’s Day!