🔥
EmojiScript
EmojiScript
Installation
Make sure you have already installed Node in your system
npm i -g the-emojiscript
Usage:
Create a new file script.emoji
, you can also use .🔥
extension
Edit the file with any text editor.
🔊"Hello World"❗
Run:
👀 script.emoji
or
emorun script.emoji
Documentation
To comment out any line in the code you have to use 💬
.
💬 This is a comment
💬 This is another comment
Variables
Variables can be declared using ➡️
.
a ➡️ 10
b ➡️ 20
c ➡️ "Hello"
d ➡️ a + b
Conditionals
EmojiScript 🤔
block will execute if condition is true, otherwise 😌
will be execute.
a ➡️ 10
🤔 a > 20 👉
🔊"a is greater than 20"❗
👈
😌 👉
🔊"a is less than 20"❗
👈
For Loop
You can use 🌀
for loop, give a range in a identifier using ➡️
as initializedValue, condititonalValue, updation
.
🌀 i ➡️ 1, 10, 1 👉
🔊"Hello World"❗
👈
While Loop
Statements inside 🤗
blocks are executed as long as specified condition evaluates to true. Once the condition will become false it will break the loop.
i ➡️ 0
🤗 i < 10 👉
🔊"Hello World"❗
🤔 i == 5 👉
🚫
👈
i+1
👈
To print any thing in console use 🔊...❗
and 🔗
instead of ,
.
🔊"This is a string"❗
a ➡️ "World"
🔊"Hello, " 🔗 a❗
Function
You can also make functions in emojiscript use 🌏
before function name and pass the arguments after 🤌
.
🌏 myFun 🤌 x, y 👉
🙏 x + y
👈
myFun 🤌 5, 5
Math Functions
There are some pre-defined math functions in emojiscript ⚡
returns power of a number, 🟥
returns square root of a number, 🪵
returns log value and 🍰/🍕
returns the PI value.
⚡ 2, 3 ❗
🟥 49 ❗
🪵 2 ❗