jaan v1.2.1
Introduction π
JaanLang is a language for couples. It is designed to be a fun and easy way to communicate with your partner. It is inspired by the way couples talk to each other and the way they express their love. It is a simple and easy to learn language that can be used to write small programs and scripts.
Starting program π
Programs must start with hi jaan and end with bye jaan
hi jaan
# Your code here
bye jaanVariables π
Variables are placeholder to store some data. Assuming your name is 'Alen'. Here, name is a variable and 'Alen' is its value. Similarly 'age' can be also a variable. To use a variable in your program you must have to declare it first.
To declare a variable, you can use the dhoro keyword followed by the variable name and its value.
For example:
dhoro tmrCG holo 3.2
dhoro amrCG holo 3.8Value is optional. If you don't provide a value, it will be set to 0 by default.
Conditions π€
Conditional statements allow your program to make decisions based on certain conditions.
If condition π€
To perform a task if a condition is true, you can use the jodi keyword and end the block with huh.
For example:
amrCG jodi tmrCG er beshi hoy tahole
bolo "I love you"
huhHere, if the value of tmrCG is greater than amrCG, the program will run code inside the block. In this case, it will print "I love you".
na hoy|hoy|er beshi na hoy|er kom na hoy|er beshi hoy|er kom hoy|er soman na hoy|er soman hoy
Comparison operators π€
You can use the following comparison operators to compare two values:
hoy π€π€
In words it means equal to. Used with value on the right side. Example:
tmrCG jodi 3.2 hoyif tmrCG is equal to 3.2.
er soman hoy π€π€
In words it means equal to. Used with variable on the left side. Example:
tmrCG jodi amrCG er soman hoyif tmrCG is equal to amrCG.
er beshi hoy π
In words it means greater than. Used with both value and variable. Example:
tmrCG jodi 3.2 er beshi hoyif tmrCG is greater than 3.2.
er kom hoy π
In words it means less than. Used with both value and variable. Example:
tmrCG jodi 3.2 er kom hoyif tmrCG is less than 3.2.
Negation operator β
Negation means to invert values
Use na before hoy word to negate the condition.
Example:
tmrCG jodi 3.2 na hoyif tmrCG is not equal to 3.2.
Multiple conditions π
Use and or or to check for multiple conditions.
Example:
tmrCG jodi 3.2 er beshi hoy and amrCG jodi 3.8 er kom hoyif tmrCG is greater than 3.2 and amrCG is less than 3.8.
Else πββοΈ
To perform a task if a condition is false, you can use the nahole keyword and end the block with huh. But you must use jodi before using nahole:
For example:
amrCG jodi tmrCG er beshi hoy tahole
bolo "I love you"
nahole
bolo "Breakup!!"
huhElse if πββοΈ
To check for multiple conditions, you can use the nahole jodi keyword like else if in other programming languages:
For example:
amrCG jodi tmrCG er beshi hoy tahole
bolo "I love you"
nahole jodi tmrCG er soman hoy tahole
bolo "I like you"
nahole
bolo "Breakup!!"
huhLooping β°
To repeat a task multiple times, you can use the bar keyword followed by the number of times you want to repeat the task:
For example:
5 bar
bolo "Sorry"
huhOutput:
Sorry Sorry Sorry Sorry Sorry
Here, the program will print "Sorry" 5 times.
Use a loop counter with <variable> dhore. Here the loop counter is i.
3 bar i dhore
bolo "Sorry " + i
huhOutput:
Sorry 1 Sorry 2 Sorry 3 Sorry 4 Sorry 5
Wait β±οΈ
ToοΈ wait for a certain amount of time, you can use the wait koro keyword followed by the number of seconds you want to wait:
For example:
1 sec wait koro
bolo "Hello"Use min for minutes and sec for seconds.
Output:
Hello
Here, the program will wait for 1 second before printing "Hello". You can also use variables to specify the time to wait but that should be a positive number.
Here, the program will print "Sorry" followed by the counter variable 5 times.
Happy Coding! π
Installation
Install Node.js and npm from here.
Run npm install -g jaan to install JaanLang compiler globally.
You can the use jaan command to compile and run JaanLang programs.
Run jaan -h to see the help menu.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago