asomiya 0.2.0

Control flow

Learn Asomiya

Quick start

Welcome to Asomiya! This page shows you the 80% of the language you will use every day. You don’t need to install anything: press Try it on any example to run it in your browser.

Tip

Every example on this site has two tabs: অসমীয়া (Assamese script) and English letters. They are the same program. Pick one and the whole site follows your choice.

You will learn

  • How to show text on the screen
  • How to store values in variables
  • How to make decisions and repeat things
  • How to write your own functions

Say hello

A program is a list of instructions. কোৱা (kowa, “say”) prints whatever you give it:

কোৱা("নমস্কাৰ, পৃথিৱী!")
Output
নমস্কাৰ, পৃথিৱী!
kowa("Nomoskar, prithibi!")
Output
Nomoskar, prithibi!

Remember values

ধৰা (dhora, “suppose / let”) creates a variable: a name for a value. Use + to join text.

ধৰা নাম = "অসম"
কোৱা("মোৰ ৰাজ্য " + নাম)
Output
মোৰ ৰাজ্য অসম
dhora naam = "Oxom"
kowa("mor rajyo " + naam)
Output
mor rajyo Oxom

Make decisions

যদি (jodi, “if”) runs a block only when a condition is true. নহ'লে (nohole, “otherwise”) runs when it isn’t.

ধৰা নম্বৰ = ৭৫
যদি (নম্বৰ >= ৩০) {
    কোৱা("উত্তীৰ্ণ")
} নহ'লে {
    কোৱা("আকৌ চেষ্টা কৰক")
}
Output
উত্তীৰ্ণ
dhora nombor = 75
jodi (nombor >= 30) {
    kowa("uttirno")
} nohole {
    kowa("akou sesta korok")
}
Output
uttirno

Repeat things

যেতিয়ালৈকে (jetialoike, “as long as”) repeats a block while its condition stays true:

ধৰা ক = ১
যেতিয়ালৈকে (ক <= ৩) {
    কোৱা("বাৰ", ক)
    ক = ক + ১
}
Output
বাৰ ১
বাৰ ২
বাৰ ৩
dhora k = 1
jetialoike (k <= 3) {
    kowa("bar", k)
    k = k + 1
}
Output
bar 1
bar 2
bar 3

Write functions

ফাংচন (fangchon) defines a reusable piece of code. ঘূৰাইদিয়া (ghuraidiya, “give back”) returns a result:

ফাংচন বৰ্গ(ন) {
    ঘূৰাইদিয়া ন * ন
}
কোৱা(বৰ্গ(৯))
Output
৮১
fangchon borgo(n) {
    ghuraidiya n * n
}
kowa(borgo(9))
Output
81

Next steps

You now know the core of Asomiya. Continue with Installation to run programs on your computer, or jump straight into the playground.