Skip to content

Mohammad-Palla/hyderabadi-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hyderabadi Lang

Hyderabadi lang is a toy programming language inspired from bhai lang.


Installation

npm i -g hyderabadilang

Usage

Create a new file with .baigan extension (eg: hi.baigan)


Edit the file with a text editor.
biryani shuru
  bolo yaaro "aayin... baigan";
biryani barkhast

Run

miyabhaibolte hi.baigan

Output

aayin... baigan

Documentation

General

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

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

Types

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

Built-ins

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

Conditionals

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

Loops

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published