Installation
Make sure you have already installed Node.js in your system. Write the following command in your terminal.
This will make emojiscript globally available for you with command line tool also.
Quick Start
To check whether it is installed properly or not run emojiscript command on terminal. Now create a new file and save it with .๐ฅ or .emoji extension and write some peice of code.
Assume that your file named is script.emoji, to compile and run this file type following command in your terminal.
or
Comment
EmojiScript supports single-line comments, begins with ๐ฌ. Everything after ๐ฌ is ignored by the compiler.
๐ฌ This is another comment
Print Function
To print the output, there is a builtin function that starts with ๐ and end with โ. Everything between this keyword will print the output as shown below.
name = "Parth"
๐ "Hello, " ๐ name โ
Variable & Data Types
You can define variables using โก๏ธ. Numbers and strings are like other languages, but null can be denoted as ๐ถ. ๐ฏ and ๐ are the boolean value.
b โก๏ธ 20
sum โก๏ธ a + b
text โก๏ธ "This is string"
c โก๏ธ ๐ถ
bool โก๏ธ ๐ฏ
bool โก๏ธ ๐
Conditional
EmojiScript supports if-else ladder construct, ๐ค block will execute if condition is true otherwise ๐ will execute else block.
๐ค a%2 == 0 ๐
๐ a ๐ "is a even number" โ
๐
๐ ๐
๐ a ๐ "is a odd number" โ
๐
For Loop
It supports both loops, statements inside ๐ blocks are executed as long as a specified condition evaluates to true. Once the statement become false it will break.
๐ "Hello, World" โ
๐
While Loop
๐ค blocks are executed as long as a specified condition evaluates to true.
๐ค i<10 ๐
๐ "Hello, World" โ
i++
๐
Function
You can also make functions in EmojiScript through ๐ and similar emoji arguments only passed after ๐ค.
๐ x + y
myFun ๐ค 10, 20 ๐ฌ Calling a function
Built-In Functions
There are some builtin math functions โก is for power function, ๐ฅ for square root and ๐ชต for log function.
๐ฅ 49 โ
๐ชต 10 โ