Hyderabadi lang is a toy programming language inspired from bhai lang.
npm i -g hyderabadilang
miyabhaibolte hi.baigan
aayin... baigan
biryani shuru
is the entrypoint for the program and all program must end with biryani barkhast
. Anything outside of it will be ignored.
This will be ignored
biryani shuru
// Write code here
biryani barkhast
This too
Variables can be declared using dekho yaaro ye hai
.
biryani shuru
dekho yaaro ye hai a = 10;
dekho yaaro ye hai b = "two";
dekho yaaro ye hai c = 15;
a = a + 1;
b = 21;
c *= 2;
biryani barkhast
Numbers and strings are like other languages. Null values can be denoted using nalla. sahi and galat
are the boolean values for true and false respectively
biryani shuru
dekho yaaro ye hai a = 10;
dekho yaaro ye hai b = 10 + (15*20);
dekho yaaro ye hai c = "two";
dekho yaaro ye hai d = 'ok';
dekho yaaro ye hai e = nalla;
dekho yaaro ye hai f = sahi;
dekho yaaro ye hai g = galat;
biryani barkhast
Use bolo yaaro
to print anything to console.
biryani shuru
bolo yaaro "Hello World";
dekho yaaro ye hai a = 10;
{
dekho yaaro ye hai b = 20;
bolo yaaro a + b;
}
bolo yaaro 5, 'ok', nalla , sahi , galat;
biryani barkhast
Hyderabadilang supports simple if else construct , agar patthe
block will execute if condition is sahi
and sub hath diye to
block will execute if condition is galat
.
biryani shuru
dekho yaaro ye hai a = 10;
agar patthe (a < 25) {
bolo yaaro "a is less than 25";
} sub hath diye to {
bolo yaaro "a is greater than or equal to 25";
}
biryani barkhast
Statements inside jab tak ye hai
blocks are executed as long as a specified condition evaluates to sahi. If the condition becomes galat
, statement within the loop stops executing and control passes to the statement following the loop. Use bas karo baigan
to break the loop and agla dekho baigan
to continue within loop.
biryani shuru
dekho yaaro ye hai a = 0;
jab tak ye hai (a < 10) {
a += 1;
agar patthe (a == 5) {
bolo yaaro "andar se bolo yaaro ", a;
agla dekho baigan;
}
agar patthe (a == 6) {
bas karo baigan;
}
bolo yaaro a;
}
bolo yaaro "done";
biryani barkhast