Learn Shunno
The shape of the language in one page: how a program is written, what the keywords are, and which types you get. The full reference lives at docs.stechbd.net.
Five programs, start to finish
Each one adds a single idea to the one before it. Read them in order and you have the language.
দেখাও('হ্যালো, আমি শুন্য!');- হ্যালো, আমি শুন্য!
The example from Shunno’s own documentation, unchanged. দেখাও prints its argument.
সংখ্যা বয়স = ২৫;ভগ্নাংশ উচ্চতা = ৫.৮;লেখা নাম = 'রফিক';বুল ছাত্র = সত্য;দেখাও(নাম);দেখাও(বয়স);দেখাও(উচ্চতা);দেখাও(ছাত্র);- রফিক
- ২৫
- ৫.৮
- সত্য
Four built-in types. The type name opens the declaration, the way it does in C.
সংখ্যা নম্বর = ৮৫;যদি (নম্বর >= ৮০) { দেখাও('এ প্লাস');} নাহলে_যদি (নম্বর >= ৭০) { দেখাও('এ');} নাহলে { দেখাও('আরও চেষ্টা করো');}- এ প্লাস
যদি, নাহলে_যদি and নাহলে. The comparison operators are the symbols you already know.
চলক গণনা = ১;চলক যোগফল = ০;যখন (গণনা <= ১০) { যোগফল = যোগফল + গণনা; গণনা = গণনা + ১;}দেখাও('এক থেকে দশ পর্যন্ত যোগফল');দেখাও(যোগফল);- এক থেকে দশ পর্যন্ত যোগফল
- ৫৫
যখন repeats while its condition holds. চলক declares a variable whose type is inferred.
সংখ্যা সংখ্যাটি = ২৯;চলক ভাজক = ২;বুল মৌলিক = সত্য;যখন (ভাজক < সংখ্যাটি) { যদি (সংখ্যাটি % ভাজক == ০) { মৌলিক = মিথ্যা; থামাও; } ভাজক = ভাজক + ১;}যদি (মৌলিক) { দেখাও('মৌলিক সংখ্যা');} নাহলে { দেখাও('মৌলিক নয়');}- মৌলিক সংখ্যা
Trial division, with থামাও leaving the loop early. Twenty-nine lines up as prime.
Every keyword
All of them, with what each one looks like in use.
- চলকvarDeclarationচলক ক = ৫;
- ধ্রুবকconstDeclarationধ্রুবক পাই = ৩.১৪;
- সংখ্যাintTypeসংখ্যা বয়স = ২৫;
- ভগ্নাংশfloatTypeভগ্নাংশ দাম = ৯.৫;
- লেখাstringTypeলেখা নাম = 'রফিক';
- বুলboolTypeবুল সত্যি = সত্য;
- সারিarrayTypeসারি নামগুলো;
- সত্যtrueLiteralবুল ক = সত্য;
- মিথ্যাfalseLiteralবুল খ = মিথ্যা;
- যদিifControl flowযদি (ক > ৫) { }
- নাহলেelseControl flowনাহলে { }
- নাহলে_যদিelse ifControl flowনাহলে_যদি (ক < ০) { }
- যখনwhileControl flowযখন (ক < ১০) { }
- চক্রforControl flowচক্র (ক) { }
- থামাওbreakControl flowথামাও;
- চালাওcontinueControl flowচালাও;
- এবংandOperatorযদি (ক এবং খ) { }
- অথবাorOperatorযদি (ক অথবা খ) { }
- নয়notOperatorযদি (নয় ক) { }
- ফাংশনfunctionFunctionফাংশন যোগ() { }
- পাঠাওreturnFunctionপাঠাও ফল;
- দেখাওprintBuilt-inদেখাও('হ্যালো');
The built-in types
A declaration opens with its type, and the compiler holds you to it from that point on.
সংখ্যা
Whole number
সংখ্যা বয়স = ২৫;Integers. Division between two of them truncates.
ভগ্নাংশ
Fraction
ভগ্নাংশ দাম = ৯.৫;Decimals. A সংখ্যা may be stored in one; the reverse is an error.
লেখা
Text
লেখা নাম = 'রফিক';Strings, in single or double quotes. Joined with +.
বুল
Boolean
বুল ছাত্র = সত্য;সত্য or মিথ্যা. Conditions must be one of these.
সারি
Array
সারি নামগুলো;Reserved by the language. Not covered by the in-browser interpreter.
Where to go from here
Two directions, depending on whether you want to read more or write something.